public static TargetMatcherRotation Match(GameObject subject, Transform destination, float time = 1) { TargetMatcherRotation targetMatcher = subject.AddComponent <TargetMatcherRotation>(); targetMatcher.destination = destination; targetMatcher.time = time; return(targetMatcher); }
public void MatchTarget_Sitting_CurrentSeatControl() { //print("anim event __sitdown"); // TargetMatcher.Match(gameObject, avatarTargets.bottom, SeatState.ConstraintSit.transform,2); if (SeatState == null) { return; } Transform target = SeatState.ConstraintSit.transform; TargetMatcherPosition.Match(gameObject, avatarTargets.bottom, target, 1);// 0.3f); TargetMatcherRotation.Match(gameObject, target, 0.5f); //animator.MatchTarget(target.position, target.rotation, // AvatarTarget.Body, new MatchTargetWeightMask(new Vector3(1, 1, 1), 1), 0.3f, 0.6f); }