/// <summary> /// Atualizando o turret. /// </summary> void Update() { if (!MenuPause.Paused) { this._health.Update(this._fsm.CurrentState); if (this._health.IsDead) { this._fsm.FreeComputerSpawn(); this._fsm = null; Destroy(gameObject); } if (this._fsm != null) this._fsm.Update(Time.deltaTime); } }
/// <summary> /// Iniciando as variáveis no início do script. /// </summary> void Start() { this._myTransform = transform; this._fsm = new TurretStateMachine(this._myTransform); this._health = new TurretHealth(this._myTransform.FindChild("HealthText").GetComponent<TextMesh>()); }