示例#1
0
 void Awake()
 {
     input = new EnemyInput();
     banditController.Setup(input);
     banditController.AttackHitEvent += CheckIfTargetInRange;
     banditController.DiedEvent      += Despawn;
     banditController.DiedEvent      += HandleDeath;
 }
示例#2
0
    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);
    }
示例#3
0
    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);
    }
示例#4
0
 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;
 }