예제 #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);
    }
예제 #2
0
 public void Destroy()
 {
     GamePullController.DestroyImage(healthBarRed);
     GamePullController.DestroyImage(healthBarGreen);
     healthBarRed   = null;
     healthBarGreen = null;
 }
예제 #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;
    }
예제 #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);
        }
    }
예제 #5
0
 public override void Destroy()
 {
     GamePullController.DestroyImage(gameObject);
     isStatic = false;
     GUIController.Remove(this);
 }
예제 #6
0
 public void Destroy()
 {
     animation.Destroy();
     GamePullController.DestroyImage(gameObject);
     BombsController.bombs.Remove(this);
 }
예제 #7
0
 private void Destroy()
 {
     GameController.missilesToDestroy.Add(this);
     GamePullController.DestroyImage(gameObject);
 }