private void Start() { body = this.GetRigidBody(); Game.Execute(Game.PlayerHealthUpdate, gameObject); Game.Execute(Game.SpecialUpdate, gameObject); Game.Execute(Game.PlayerBind, gameObject); }
private void SpecialPowerUp(Collider entity) { if (entity.HasNot(Tag.SPUP)) { return; } Destroy(entity.gameObject); SpecialAtk.UseCount++; Game.Execute(Game.SpecialUpdate, gameObject); }
private void HealthPowerUp(Collider entity) { if (entity.HasNot(Tag.HPUP)) { return; } Destroy(entity.gameObject); Health++; Game.Execute(Game.PlayerHealthUpdate, gameObject); }
private void IsDead() { if (Health > 0) { return; } Spawn(ExplosionPref, 1.2f); Game.Execute(Game.PlayerDie, gameObject); Destroy(gameObject); }
private void SpecialShoot() { if (SpecialAtk.UseCount < 1) { return; } if (!specialTimer.IsTimeUp(Time.fixedDeltaTime, SpecialAtk.FireRate)) { return; } if (!Game.CurrentState.Special) { return; } SpecialAtk.Shoot(this.GetPosition()); if (!SpecialAtk.HasTarget) { return; } SpecialAtk.UseCount--; specialTimer.Reset(); Game.Execute(Game.SpecialUpdate, gameObject); }
private void OnTriggerEnter(Collider entity) { if (entity.Has(Tag.Boss)) { Health = 0; IsDead(); } HealthPowerUp(entity); SpecialPowerUp(entity); if (entity.HasNot(Tag.Enemy)) { return; } Spawn(HitPref, 0.3f); Health--; if (!entity.GetComponent <BossGreatLaser>()) { Destroy(entity.gameObject); } IsDead(); Game.Execute(Game.PlayerHealthUpdate, gameObject); Game.Execute(Game.Hit, gameObject); }