public virtual GameObject PlayerSpawnBomb(Vector3 location)
 {
     if (MinusBomb())
     {
         return(ObjectSpawner.SpawnObject(ObjectToSpawn, location));
     }
     return(null);
 }
Example #2
0
        public override GameObject DummySpawnBomb(Vector3 location)
        {
            GameObject obj = null;

            obj = ObjectSpawner.SpawnObject(ObjectToSpawn, location);
            obj.GetComponent <GrenadeBomb>().Direction = direction;
            return(obj);
        }
Example #3
0
        public GameObject SpawnExplosion(Vector2 tile, int damage)
        {
            GameObject explo = ObjectSpawner.SpawnObject("Explosion", tile);
            Explosion  exp   = explo.GetComponent <Explosion>();

            exp.ID     = this.ID;
            exp.damage = damage;
            return(explo);
        }
 IEnumerator ExplodeTiles()
 {
     do
     {
         Vector2 current = TilesPos.Dequeue();
         ObjectSpawner.SpawnObject("EndExplosion", current);
         yield return(wait);
     } while (TilesPos.Count != 0);
 }
Example #5
0
        public GameObject SpawnExplosion(int x, int y, int damage)
        {
            GameObject explo = ObjectSpawner.SpawnObject("Explosion", new Vector2(x, y));
            Explosion  exp   = explo.GetComponent <Explosion>();

            exp.ID     = this.ID;
            exp.damage = damage;

            return(explo);
        }
Example #6
0
        public override GameObject PlayerSpawnBomb(Vector3 location)
        {
            GameObject obj = null;

            if (MinusBomb())
            {
                obj = ObjectSpawner.SpawnObject(ObjectToSpawn, location);
                obj.GetComponent <GrenadeBomb>().Direction = direction;
            }
            return(obj);
        }
        // Use this for initialization
        void Start()
        {
            int x = TileMapInterfacer.Instance.TileMap.size_x;
            int y = TileMapInterfacer.Instance.TileMap.size_z;

            x       /= 2;
            y       /= 2;
            location = TileMapInterfacer.Instance.TileMap.ConvertTileToWorld(new Vector2(x, y));
            ObjectSpawner.SpawnObject(spawnTile, location);
            wait = new WaitForSeconds(waitSeconds);
            StartCoroutine(DropItemsTimer());
        }
        IEnumerator DropItemsTimer()
        {
            while (true)
            {
                while (controller.GameHasStarted)
                {
                    if (currentObj != null)
                    {
                        while (currentObj.activeInHierarchy)
                        {
                            yield return(null);
                        }
                    }
                    yield return(wait);

                    currentObj = ObjectSpawner.SpawnObject(ObjectToDrop, location);
                }
                yield return(null);
            }
        }
 public virtual GameObject DummySpawnBomb(Vector3 location)
 {
     return(ObjectSpawner.SpawnObject(ObjectToSpawn, location));
 }
 public override GameObject PlayerSpawnBomb(Vector3 location)
 {
     return(ObjectSpawner.SpawnObject("SmallBomb", location));
 }