private void FadeToMoveOrHold() { if (m_CharacterAnimationInfo.IsMoving) { MovementMode moveMode = GetOwner().GetMovementStateInfo().MovementMode; RelMoveDir moveDir = GetOwner().GetMovementStateInfo().RelativeMoveDir; StartMoveAnimation(); } else { FadeToHold(); } }
protected void GetAnimationDirAndSpeed(MovementMode mode, RelMoveDir rmd, float move_speed, out Animation_Type at, out float speed_factor) { Data_ActionConfig action_config = m_CurActionConfig; if (mode == MovementMode.LowSpeed) { at = Animation_Type.AT_SlowMove; } else if (mode == MovementMode.HighSpeed) { at = Animation_Type.AT_FastMove; } else { at = new Animation_Type[] { Animation_Type.AT_Idle0, // N Animation_Type.AT_RunForward, // F Animation_Type.AT_RunBackward, // B Animation_Type.AT_Idle0, // N Animation_Type.AT_RunLeft, // L Animation_Type.AT_RunForwardLeft, // LF Animation_Type.AT_RunBackwardLeft, // BL Animation_Type.AT_Idle0, // N Animation_Type.AT_RunRight, // R Animation_Type.AT_RunForwardRight, // FR Animation_Type.AT_RunBackwardRight, // BR }[(int)rmd]; } // N F B N L LF BL N R FR BR //speed_factor = new float[] { 0f, 1f, 1 / 2f, 0f, 3 / 4f, 7 / 8f, 5 / 8f, 0f, 3 / 4f, 7 / 8f, 5 / 8f }[(int)rmd]; if (action_config != null) { if (mode == MovementMode.LowSpeed) { speed_factor = move_speed / action_config.m_SlowStdSpeed; } else if (mode == MovementMode.HighSpeed) { speed_factor = move_speed / action_config.m_FastStdSpeed; } else { speed_factor = new float[] { 0f, //N move_speed / action_config.m_ForwardStdSpeed, //F move_speed / action_config.m_BackStdSpeed, //B 0f, //N move_speed / action_config.m_LeftRightStdSpeed, //L move_speed / action_config.m_LeftRightForwardStdSpeed, // LF move_speed / action_config.m_LeftRightBackStdSpeed, //LB 0f, move_speed / action_config.m_LeftRightStdSpeed, //R move_speed / action_config.m_LeftRightForwardStdSpeed, //RF move_speed / action_config.m_LeftRightBackStdSpeed //RB }[(int)rmd]; } } else { speed_factor = 1.0f; } }