示例#1
0
    void CheckJumpOver()
    {
        Ray        ray = new Ray(transform.position, transform.forward);
        RaycastHit hit;

        Debug.DrawRay(ray.origin, ray.direction * hitDistance, Color.red, 1);

        if (Physics.Raycast(ray, out hit, hitDistance))
        {
            if (!me.GetGrounded())
            {
                me.Activate("JumpOver");
                me.CustomImpulsion(0.1f * transform.forward + transform.up, 10.5f, 0.0f, 0.1f);
            }
        }
    }