コード例 #1
0
    // Update is called once per frame
    protected override void Update()
    {
        if (IsPhysicsGrounded() != true)
        {
            m_FrameNotGrounded++;
        }
        else
        {
            m_FrameNotGrounded = 0;
        }

        ApplyAnimEventData(m_AnimEventData);
        ApplyGravityAndForce(Time.deltaTime);

        Vector3 currTotalVel = m_CurrVelocity;

        ///*if (IsGrounded())
        {
            currTotalVel += transform.forward * m_CurrentMoveSpeed;
        }//*/

        m_LastFrameMoveVelocity = currTotalVel;

        //Debug.Log("########## Velocity : " + currTotalVel);

        m_CollisionFlags = m_CharacterController.Move(currTotalVel * Time.deltaTime);

        if (m_Flag.CheckFlag((uint)CharacterFlag.eCF_ResetMoveSpeedAfterUse) == true)
        {
            CurrentMoveSpeed = 0.0f;
        }
    }