Example #1
0
        public void Init(Player _player)
        {
            player   = _player;
            playerSM = GetComponent <Animator>();

            context = new PlayerSMContext(player, LevelManager.instance.GetUIGameplayManager(), LevelManager.instance.GetCheckpointManager());

            foreach (StateMachineBehaviour state in playerSM.GetBehaviours <StateMachineBehaviour>())
            {
                IState newstate = state as IState;
                if (newstate != null)
                {
                    newstate.Setup(context);
                }
            }

            OnPlayerEnemyParaiste    += HandlePlayerEnemyParasite;
            OnPlayerPlatformParaiste += HandlePlayerPlatformParasite;
            OnPlayerNormal           += HandlePlayerNormal;
            GoToDeath += HandlePlayerDeath;

            playerSM.SetTrigger("StartSM");
        }
Example #2
0
 public override void Setup(IStateMachineContext _context)
 {
     context = _context as PlayerSMContext;
 }