コード例 #1
0
    void Bounce(float _velocityy)
    {
        if (bounce)
        {
            Vector2 reflectionVector;
            //m_movementController.groundCheck = false;
            _collisionNormal.Normalize();
            reflectionVector = (Vector2)Vector3.Reflect((Vector3)m_actorReference.GetPhysicsController().LastVelocity, _collisionNormal);               // HACKY. We're not taking collision normals, we're using just Vector2.up

            m_actorReference.GetPhysicsController().Velocity = reflectionVector * bounceDampener;
            m_fsmReference.SetCurrentState(PlayerFSM.States.BOUNCE, true);
            bounce = false;
        }
    }