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)); } }
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)); } }