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