Пример #1
0
        public static void AddNewParent(InAudioNode node, AudioNodeType parentType)
        {
            InUndoHelper.RecordObject(new Object[] { node, node._parent }, "Undo Add New Parent for " + node.Name);
            var newParent = CreateNode(node.gameObject, node._parent, parentType);
            var oldParent = node._parent;

            newParent.MixerGroup = node.MixerGroup;
            newParent.EditorSettings.IsFoldedOut = true;

            int index = oldParent._children.FindIndex(node);

            NodeWorker.RemoveFromParent(node);
            node.AssignParent(newParent);

            OnRandomNode(newParent);

            NodeWorker.RemoveFromParent(newParent);
            oldParent._children.Insert(index, newParent);
        }
Пример #2
0
        public static void AddNewParent(InAudioNode node, AudioNodeType parentType)
        {
            InUndoHelper.RecordObject(new Object[] { node, node._parent, node.GetBank() }, "Undo Add New Parent for " + node.Name);
            var newParent = CreateNode(node.gameObject, node._parent, parentType);
            var oldParent = node._parent;

            newParent.MixerGroup = node.MixerGroup;
            newParent.FoldedOut  = true;
            if (node._type == AudioNodeType.Folder)
            {
                InFolderData data = (InFolderData)newParent._nodeData;
                data.BankLink = oldParent.GetBank();
            }
            int index = oldParent._children.FindIndex(node);

            NodeWorker.RemoveFromParent(node);
            node.AssignParent(newParent);

            OnRandomNode(newParent);

            NodeWorker.RemoveFromParent(newParent);
            oldParent._children.Insert(index, newParent);
        }