예제 #1
0
        private void CreateFishes()
        {
            int num = 0;

            while (num < this.m_FishCount && this.m_Fishes.Count < this.m_CurrentFishesCount)
            {
                Vector3    randomPointInTankSpace = this.GetRandomPointInTankSpace(true, 0.5f);
                GameObject gameObject             = (this.m_Prefabs.Count <= 0) ? null : this.m_Prefabs[UnityEngine.Random.Range(0, this.m_Prefabs.Count)];
                GameObject gameObject2            = UnityEngine.Object.Instantiate <GameObject>(gameObject, randomPointInTankSpace, Quaternion.identity);
                gameObject2.transform.localScale *= UnityEngine.Random.Range(this.m_MinScale, this.m_MaxScale);
                Fish component = gameObject2.GetComponent <Fish>();
                component.enabled = true;
                component.SetTank(this);
                component.SetPrefab(gameObject);
                this.m_Fishes.Add(component);
                Collider component2 = component.GetComponent <Collider>();
                Physics.IgnoreCollision(Player.Get().GetComponent <Collider>(), component2, true);
                num++;
            }
        }
예제 #2
0
        private void CreateFishes()
        {
            int num = 0;

            while (num < this.m_FishCount && this.m_Fishes.Count < this.m_CurrentFishesCount)
            {
                Vector3    randomPointInTankSpace = this.GetRandomPointInTankSpace();
                GameObject gameObject             = (this.m_Prefabs.Count > 0) ? this.m_Prefabs[UnityEngine.Random.Range(0, this.m_Prefabs.Count)] : null;
                AI         component = gameObject.GetComponent <AI>();
                if (!(component != null) || DifficultySettings.IsAIIDEnabled(component.m_ID))
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(gameObject, randomPointInTankSpace, Quaternion.identity);
                    gameObject2.transform.localScale *= UnityEngine.Random.Range(this.m_MinScale, this.m_MaxScale);
                    Fish component2 = gameObject2.GetComponent <Fish>();
                    component2.enabled = true;
                    component2.SetTank(this);
                    component2.SetPrefab(gameObject);
                    this.m_Fishes.Add(component2);
                    Collider component3 = component2.GetComponent <Collider>();
                    Physics.IgnoreCollision(Player.Get().m_Collider, component3, !component2.IsStringray());
                }
                num++;
            }
        }