protected override CharacterAction OnUpdateAction() { PlayerCharacter player = CurrentCharacter as PlayerCharacter; CharacterPhysicCharacterController physic = player.ChildPhysic as CharacterPhysicCharacterController; //실제 구르기 처리되는 시간 m_Timer += Time.unscaledDeltaTime * player.PlayerTimeScale; if (m_Timer <= data.Rolling_RollTime) { float normalizedTime = Mathf.Clamp01(m_Timer / data.Rolling_RollTime); float dashSpeedFactor = data.Rolling_MoveSpd / data.Char_MoveSpd; physic.Move(m_DashDirection * dashSpeedFactor * data.Rolling_Curve.Evaluate(normalizedTime)); } //캔슬 if (data.Rolling_ActiveTime <= m_Timer) { CharacterAction action = base.OnUpdateAction(); if (action != this) { return(action); } } //대쉬 애니메이션이 끝났으면 끝... if (m_IsDashEnd) { return(player.DefaultAction); } return(this); }
protected override CharacterAction OnUpdateAction() { //사용할 값들 캐스팅 (에러나면 게임작동하면 안되니까 그냥 예외처리 없음) PlayerCharacterControl control = CurrentCharacter.CurrentControl as PlayerCharacterControl; PlayerCharacter player = CurrentCharacter as PlayerCharacter; CharacterPhysicCharacterController physic = player.ChildPhysic as CharacterPhysicCharacterController; //기본 업데이트 (다른 액션으로 이동 처리) CharacterAction action = base.OnUpdateAction(); if (action != this) { return(action); } //Move if (0.1f < control.Move.magnitude) { CurrentAni.PlayAnimation("Move"); player.SetLookVector(control.Move, false); physic.Move(control.Move); } //Idle else { CurrentAni.PlayAnimation("Idle"); } return(this); }