private void Awake() { m_hActor = GetComponent<MadMaxActor>(); m_hRigidbody = GetComponent<Rigidbody>(); m_hLight = GetComponentInChildren<Light>(); m_hBulb = new LightBulb(this); inactive = new StateInactive(this); active = new StateActive(this); explode = new StateExplode(this); inactive.Active = active; active.Inactive = inactive; active.Explode = explode; explode.Inactive = inactive; inactive.OnStateEnter(); currentState = inactive; m_hBulb.Reset(); }
private void Damage(MadMaxActor hActor, float dmg) { if (hActor == this) return; LastActor = hActor; this.currentHealth -= hActor.GetImpactDamage(dmg); if (this.currentHealth <= 0f) { HealthBar.enabled = false; RpcDie(hActor.netId); } }