Untitled

mail@pastecode.io avatarunknown
plain_text
2 months ago
837 B
1
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();
    }