示例#1
0
 public static void ApplyTransform(Transform fromTrans, Transform toTrans, bool isLocal)
 {
     if (isLocal)
     {
         toTrans.localPosition = fromTrans.localPosition;
         toTrans.localRotation = fromTrans.localRotation;
         toTrans.localScale    = fromTrans.localScale;
     }
     else
     {
         toTrans.position   = fromTrans.position;
         toTrans.rotation   = fromTrans.rotation;
         toTrans.localScale = Vector3.Scale(fromTrans.lossyScale, CocoMath.Divide(toTrans.localScale, toTrans.lossyScale));
     }
 }
示例#2
0
 public void ApplyToTransform(Transform trans)
 {
     if (IsLocal)
     {
         trans.localPosition    = Position;
         trans.localEulerAngles = EulerAngles;
         trans.localScale       = Scale;
     }
     else
     {
         trans.position    = Position;
         trans.eulerAngles = EulerAngles;
         trans.localScale  = Vector3.Scale(Scale, CocoMath.Divide(trans.localScale, trans.lossyScale));
     }
 }