public static void NormaliseScale(NodeBehaviour node)
        {
            if (node == null || node.GetScale() == Vector3.one)
            {
                return;
            }

            foreach (var child in node.Children)
            {
                child.transform.localScale    = NodeHelper.Scale(child.transform.localScale, node.transform.localScale);
                child.transform.localPosition = NodeHelper.Scale(child.transform.localPosition, node.transform.localScale);

                if (child.ScaleFromChild)
                {
                    NormaliseScale(child);
                }
            }
            node.transform.localScale = Vector3.one;
        }
Esempio n. 2
0
            private NodeBehaviour createQuad(string nameDirection, Vector3 pos, Vector3 sca, Quaternion rot, NodeBehaviour parent)
            {
                var creator = new QuadCreator(string.Format("{0} {1}", this.name, nameDirection), NodeHelper.Scale(pos, this.scale / 2), sca)
                {
                    rotation = rot
                };
                var node = creator.Create();

                node.SetParent(parent);
                node.noJson = true;
                return(node);
            }