void Awake() { input = new EnemyInput(); banditController.Setup(input); banditController.AttackHitEvent += CheckIfTargetInRange; banditController.DiedEvent += Despawn; banditController.DiedEvent += HandleDeath; }
void Awake() { input = new EnemyInput(); banditController.Setup(input); banditController.AttackHitEvent += CheckIfTargetInRange; banditController.DiedEvent += Despawn; banditController.DiedEvent += HandleDeath; banditController.AttackedEvent += () => RuntimeManager.PlayOneShot(attackEvent); banditController.JumpedEvent += () => RuntimeManager.PlayOneShot(jumpEvent); banditController.LandedEvent += () => RuntimeManager.PlayOneShot(landingEvent); banditController.DiedEvent += () => RuntimeManager.PlayOneShot(deathEvent); banditController.FootstepEvent += () => RuntimeManager.PlayOneShot(footstepEvent); }
void Awake() { input = new EnemyInput(); banditController.Setup(input); banditController.AttackHitEvent += CheckIfTargetInRange; banditController.DiedEvent += Despawn; banditController.DiedEvent += HandleDeath; banditController.JumpedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Jump); banditController.LandedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Landing); banditController.AttackedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Attack); banditController.DiedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Death); banditController.FootstepEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Footstep); banditController.BlockedHitEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.BlockHit); banditController.GotHitEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.GotHit); }
void Initialise() { if (initialised) { return; } foreach (var subsystem in subsystems) { subsystem.Initialise(this); } banditController.JumpedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Jump); banditController.LandedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Landing); banditController.AttackedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Attack); banditController.DiedEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Death); banditController.FootstepEvent += () => NotifySubsystemsAboutNewEvent(PlayerEventType.Footstep); banditController.AttackHitEvent += CheckForTargetsAndHit; input = new PlayerInput(); banditController.Setup(input); initialised = true; }