public static Vector3 Snap(Vector3 original) { return(new Vector3( PixelPerfect.Snap(original.x), PixelPerfect.Snap(original.y), PixelPerfect.Snap(original.z) )); }
void CtrlCollect() { if (isJointed) { return; } isJointed = IsJointedRoot() || IsJointedOther(); if (isJointed) { transform.localPosition = PixelPerfect.Snap(transform.localPosition); return; } transform.position = Vector2.MoveTowards( transform.position, collectedFrom.transform.position, collectedSpeed * Time.deltaTime ); }