Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
837 B
2
Indexable
Never
jointpoint    

public void OnTouchStart()
    {
        IsPressed = true;
    }

    public void OnTouchEnd()
    {
        IsPressed = false;
        tempIKPoint = Bone.position;
    }

    private void LateUpdate()
    {
        if (jointType == JointType.Hips)
            return;

        if (!IsPressed)
            point.position = Vector3.Lerp(point.transform.position, tempIKPoint, Time.deltaTime * 5);
    }





character bone handler


  void OnMouseRelease()
    {
        CurrentPoint.OnTouchEnd();
        CurrentPoint = null;
    }
    void OnMouseTouch()
    {
        CurrentPoint = null;
        GameManager.Instance.levelManager.pointsHandler.GetNearestPoint(Input.mousePosition, ref CurrentPoint);
        if (CurrentPoint)
            CurrentPoint.OnTouchStart();
    }