Пример #1
0
        void SpawnSpikeByType(ESpikeType _type, float _yy)
        {
            GameObject go = ObjectPoolManager.Spawn(prefabSpikes[(int)_type]);

            go.tag = "Spike";
            Vector3 pos = Vector3.zero;

            pos.y = _yy;
            go.transform.parent   = rootSpike;
            go.transform.position = pos;
            Utils.setActive(go, true);
        }
Пример #2
0
 void Start()
 {
     _instance = this;
     ObjectPoolManager.Init(rootSpike);
     for (int i = 0; i < prefabSpikes.Length; i++)
     {
         ObjectPoolManager.New(prefabSpikes[i], 3);
     }
     ObjectPoolManager.New(prefabCheckpoint, 1);
     cameraGame = GetComponent <Camera>();
     spikeGen   = GetComponent <SpikeGenerator>();
 }
Пример #3
0
 public void Deactivate()
 {
     ObjectPoolManager.Unspawn(this.gameObject);
 }