Exemplo n.º 1
0
        public static void SpawnRainArrows()
        {
            // Spawn RAIN ARROWS
            Statics.GenerateInstance(Constants.COLLECTION_NONE, Constants.TAG_RAINARROWS, new Vector3(0, 0, 0));

            // Insert it in the main camera
            GameObject rainArrow = GameObject.FindGameObjectWithTag(Constants.TAG_RAINARROWS);

            rainArrow.transform.parent        = GameObject.FindGameObjectWithTag(Constants.TAG_JACK).transform;
            rainArrow.transform.localPosition = new Vector3(-1000, 1000, 0);
        }
Exemplo n.º 2
0
        IEnumerator Spawn(Spawner spawner)
        {
            while (true)
            {
                for (int i = 0; i < spawner.getQuantity(); i++)
                {
                    //if (Track >= TrackMaximum) Track = 0; // Reset track counter
                    float randomSpawnTime = Random.Range(Constants.MIN_SPAWN_WAIT_TIME, Constants.MAX_SPAWN_WAIT_TIME);
                    yield return(new WaitForSeconds(randomSpawnTime));

                    Statics.GenerateInstance(Constants.COLLECTION_ENEMIES, spawner.getTag(), PgtNavigator.EnemiesSpawnPosition + new Vector3(0, 0, Track));
                    //Track += TrackIncreaser;
                }
                yield break;
                yield return(0);
            }
        }
Exemplo n.º 3
0
        public void CreateTower(string TowerType)
        {
            Vector3 Position = PgtNavigator.TowerSpawnPosition;

            // Rock towers at floor
            if (TowerType == Constants.TAG_TOWER_ROCKS)
            {
                Position.y = Constants.FLOOR_Y_POSITION;
            }
            // Arrow tower is on top of the tower.
            if (TowerType == Constants.TAG_TOWER_ARROWS)
            {
                Position.y = Position.y + gameObject.renderer.bounds.size.y / 2;
            }
            // Generate the instance
            Statics.GenerateInstance(Constants.COLLECTION_ALLIES, TowerType, Position);

            // Hide the control of the tower
            this.CreateControls[TowerType].SetActive(false);

            // Show the control to remove the tower
            this.RemoveControls[TowerType].SetActive(true);
        }
Exemplo n.º 4
0
 public static void SpawnBarricade()
 {
     // Spawn BARRICADE (Home)
     Statics.GenerateInstance(Constants.COLLECTION_ALLIES, Constants.TAG_BARRICADE, PgtNavigator.BarricadeSpawnPosition);
     //Statics.allies.GenerateInstance(AlliesCollection.BARRICADE, BarricadeSpawnPosition);
 }
Exemplo n.º 5
0
 public static void SpawnTrap()
 {
     // Spwan TRAP
     Statics.GenerateInstance(Constants.COLLECTION_NONE, Constants.TAG_TRAP, PgtNavigator.TrapSpawnPosition);
 }
Exemplo n.º 6
0
 public static void SpawnMainCharacter()
 {
     // Spawn JACK
     Statics.GenerateInstance(Constants.COLLECTION_ALLIES, Constants.TAG_JACK, PgtNavigator.JackSpawnPosition);            //JackSpawnPosition
     //Statics.allies.GenerateInstance(AlliesCollection.MAIN_CHARACTER, JackSpawnPosition);
 }
Exemplo n.º 7
0
 public static void SpawnTower()
 {
     // Spawn Tower
     Statics.GenerateInstance(Constants.COLLECTION_NONE, Constants.TAG_TOWER_STRUCTURE, PgtNavigator.TowerSpawnPosition);
     //Statics.allies.GenerateInstance(AlliesCollection.BARRICADE, BarricadeSpawnPosition);
 }
Exemplo n.º 8
0
 public static void SpawnDog()
 {
     // Spawn DOG (pet)
     Statics.GenerateInstance(Constants.COLLECTION_ALLIES, Constants.TAG_DOG, PgtNavigator.DogSpawnPosition);
     //Statics.allies.GenerateInstance(AlliesCollection.BARRICADE, BarricadeSpawnPosition);
 }