Untitled
unknown
plain_text
2 years ago
837 B
10
Indexable
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();
}
Editor is loading...