Exemple #1
0
        public static void ReverseRecursive(this Transform root, IAxisInverter axisInverter)
        {
            var globalMap = root.Traverse().ToDictionary(x => x, x => PosRot.FromGlobalTransform(x));

            foreach (var x in root.Traverse())
            {
                x.position = axisInverter.InvertVector3(globalMap[x].Position);
                x.rotation = axisInverter.InvertQuaternion(globalMap[x].Rotation);
            }
        }
Exemple #2
0
        public static void ReverseZ(this Transform root)
        {
            var globalMap = root.Traverse().ToDictionary(x => x, x => PosRot.FromGlobalTransform(x));

            foreach (var x in root.Traverse())
            {
                x.position = globalMap[x].Position.ReverseZ();
                x.rotation = globalMap[x].Rotation.ReverseZ();
            }
        }