Esempio n. 1
0
    public void Destroy(bool createTowerPlace = true)
    {
        if (createTowerPlace)
        {
            GameObject towerPlace = GamePullController.CreateImage();
            towerPlace.GetComponent <BoxCollider> ().enabled = true;

            switch (color)
            {
            case TeamColor.Red:
                GameController.towerPlacesRed.Add(towerPlace);
                break;

            case TeamColor.Blue:
                GameController.towerPlacesBlue.Add(towerPlace);
                break;
            }
            towerPlace.transform.position = towerPlacePosition;
            towerPlace.GetComponent <Renderer>().material.mainTexture
                = Resources.Load("Textures/Towers/TowerPlace" + color) as Texture;
            towerPlace.transform.localScale = new Vector3(3.08f * Settings.FhdToHD, 4.13f * Settings.FhdToHD, 1);
            towerPlace.name = "TowerPlace" + color;
        }

        GameController.towers.Remove(this);
        GameController.towersDictionary.Remove(gameObject);
        GamePullController.DestroyImage(gameObject);
    }
Esempio n. 2
0
 public void Destroy()
 {
     GamePullController.DestroyImage(healthBarRed);
     GamePullController.DestroyImage(healthBarGreen);
     healthBarRed   = null;
     healthBarGreen = null;
 }
Esempio n. 3
0
    public void Destroy()
    {
        if (rootImage != null)
        {
            rootImage.Destroy();
        }

        GameController.unitsToDestroy.Add(this);
        GamePullController.DestroyImage(gameObject);
        objectAnimation.Destroy();
        GameController.unitsDictionary.Remove(gameObject);
        gameObject      = null;
        objectAnimation = null;
        healthBar       = null;
        shadow          = null;
    }
Esempio n. 4
0
    protected override void Kill()
    {
        if (isKilling)
        {
            return;
        }

        isKilling = true;
        objectAnimation.Load((Random.value > 0.5f?"Bang":"BangNoFire"), 20);
        objectAnimation.Play(-1, Destroy);
        gameObject.transform.localScale = new Vector3(1.5f, 1.5f, 1);

        if (shadow != null)
        {
            GamePullController.DestroyImage(shadow);
        }
    }
Esempio n. 5
0
 public override void Destroy()
 {
     GamePullController.DestroyImage(gameObject);
     isStatic = false;
     GUIController.Remove(this);
 }
Esempio n. 6
0
 public void Destroy()
 {
     animation.Destroy();
     GamePullController.DestroyImage(gameObject);
     BombsController.bombs.Remove(this);
 }
Esempio n. 7
0
 private void Destroy()
 {
     GameController.missilesToDestroy.Add(this);
     GamePullController.DestroyImage(gameObject);
 }