private void Update() { ThisEvent = SAnimationEvent.Null; }
public void Event(SAnimationEvent SEvent, PlayerControler.PlayerState _State) { if (SEvent == SAnimationEvent.Jumping) { _SonicBody.SetActive(true); _BallBody.SetActive(false); _PC._SonicAudio.Play("Jump"); if (_State == PlayerControler.PlayerState.Normal) { //TODO: Play Jumping Animation } else if (_State == PlayerControler.PlayerState.RailGrinding) { //TODO: Play Jump from Rail Animation } } else if (SEvent == SAnimationEvent.Groundpounding) { _PC._SonicAudio.Play("Stomp_Start"); _SonicBody.SetActive(true); _BallBody.SetActive(false); } else if (SEvent == SAnimationEvent.HomingAttack) { _PC._SonicAudio.Play("Homing"); _SonicBody.SetActive(true); _BallBody.SetActive(false); } else if (SEvent == SAnimationEvent.AttackHit) { _SonicBody.SetActive(true); _BallBody.SetActive(false); _PC._Ball = false; int Num = Random.Range(1, 6); Play("Homing_Trick_" + Num); Debug.Log("Homing_Trick_" + Num); WaitTime = 20; _PC._PlayerState = PlayerControler.PlayerState.Normal; } else if (SEvent == SAnimationEvent.SpinDash) { _BallBody.SetActive(true); RaycastHit _Hit; _BallBody.transform.localRotation = Quaternion.identity; if (Physics.Raycast(transform.position, -transform.up, out _Hit, _PC.Height, _Ground)) { //_BallBody.transform.position = _Hit.point; } } else if (SEvent == SAnimationEvent.Normal) { _SonicBody.SetActive(true); _BallBody.SetActive(false); } else if (SEvent == SAnimationEvent.Kick) { Play("Squat_Kick"); SetSpeed(1); WaitTime = 30; _PC._AttackLevel = DamageObject.AttackLevel.L3; _PC._DefenseLevel = DamageObject.DefenseLevel.L2; } else if (SEvent == SAnimationEvent.Pulley) { if (_State != PlayerControler.PlayerState.InteractOverride) { Play("PulleyUp_Loop"); } else { Play("PulleyJump"); WaitTime = 10; } } }