Ejemplo n.º 1
0
 void Update()
 {
     if (CanFire && TurretTransforms != null)
     {
         foreach (Transform T in TurretTransforms)
         {
             PumpkinManager.SpawnAmmo(T.position, T.rotation);
             Debug.Log("Pumpkin ammo fired");
         }
         CanFire = false;
         Invoke("EnableFire", ReloadDelay);
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     if (AmmoManagerSingleton != null)
     {
         Destroy(GetComponent <AmmoManager>());
         return;
     }
     AmmoManagerSingleton = this;
     AmmoArray            = new GameObject[PoolSize];
     for (int i = 0; i < PoolSize; ++i)
     {
         AmmoArray[i] = Instantiate(AmmoPrefab, Vector3.zero, Quaternion.identity, transform) as GameObject;
         Transform ObjTransform = AmmoArray[i].transform;
         AmmoQueue.Enqueue(ObjTransform);
         AmmoArray[i].SetActive(false);
     }
 }