Revert() public method

public Revert ( ) : void
return void
Ejemplo n.º 1
0
 /// <summary>
 /// Moves toMove, retaining the local position, scale, rotation.
 /// 
 /// This is in contrast to simply modifying Transform.parent, which modifies
 /// the local transformation state to retain the same world-space result.
 /// </summary>
 /// <param name="toMove">The Transform to reparent.</param>
 /// <param name="newParent">The new parent Transform.</param>
 public static void MoveToParent(Transform toMove, Transform newParent)
 {
     var state = new TransformState(toMove);
     toMove.parent = newParent;
     state.Revert();
 }