void Start() { /// Suscribete al estado muerte con la funcion spawndead. deadState.SuscribeOnStart(SpawnDead); moveState.SuscribeOnStart(StartMove); moveState.SuscribeOnJump(JumpMove); moveState.SuscribeOnEnd(EndMove); audioRun = GetComponent <AudioSource>(); }
void OnEnable() { if (object.ReferenceEquals(KlausDead, null)) { KlausDead = GameObject.FindObjectOfType <DeadState>(); KlausMove = GameObject.FindObjectOfType <MoveState>(); } KlausDead.onRespawn += OnDead; KlausMove.SuscribeOnJump(OnJump); }
void Start() { volumeP = GetComponent <AudioSource>().volume; /// Suscribete al estado muerte con la funcion spawndead. deadState.SuscribeOnStart(SpawnDead); moveState.SuscribeOnStart(StartMove); moveState.SuscribeOnJump(JumpMove); moveState.SuscribeOnEnd(EndMove); crouchState.SuscribeOnStart(Crouching); throwState.SuscribeOnStart(Throwing); // crushState.SetFunct(Crushing, CrouchingEND); throwState.SuscribeOnEnd(Throwing2); }
// Use this for initialization protected virtual void OnEnable() { move.SuscribeOnJump(Jump); speedStore = 0; }