Example #1
0
        public static InAudioNode CreateNode(GameObject go, InAudioNode parent, AudioNodeType type)
        {
            var newNode = CreateNode(go, parent, GUIDCreator.Create(), type);

            AddDataClass(newNode);
            return(newNode);
        }
Example #2
0
        public static InAudioBankLink CreateTree(GameObject go)
        {
            var root = CreateRoot(go, GUIDCreator.Create());
            var link = CreateBankLink(go, root, GUIDCreator.Create());

            SaveAndLoad.CreateAudioBank(link.GUID);
            return(root);
        }
Example #3
0
        public static InAudioEventNode CreateNode(InAudioEventNode parent, EventNodeType type)
        {
            var child = CreateEvent(parent.gameObject, parent, GUIDCreator.Create(), type);

            child.FoldedOut = true;

            return(child);
        }
Example #4
0
        public static InAudioBus CreateChild(InAudioBus parent)
        {
            var child = CreateBus(parent.gameObject, parent, GUIDCreator.Create());

            child.FoldedOut = true;
            child.Name      = parent.Name + " Child";

            return(child);
        }
Example #5
0
        public static InAudioEventNode CreateTree(GameObject go, int levelSize)
        {
            var tree = CreateRoot(go, GUIDCreator.Create());

            for (int i = 0; i < levelSize; ++i)
            {
                CreateFolder(go, GUIDCreator.Create(), tree);
            }

            return(tree);
        }
Example #6
0
        public static InAudioNode CreateTree(GameObject go, int numberOfChildren, InAudioBus bus)
        {
            var Tree = CreateRoot(go, GUIDCreator.Create());

            Tree.Bus = bus;
            for (int i = 0; i < numberOfChildren; ++i)
            {
                var newNode = CreateNode(go, Tree, GUIDCreator.Create(), AudioNodeType.Folder);
                AddDataClass(newNode);
            }
            return(Tree);
        }
Example #7
0
        public static InAudioNode CreateChild(InAudioNode parent, AudioNodeType newNodeType)
        {
            var bank = parent.GetBank();

            UndoHelper.RecordObject(UndoHelper.Array(parent, parent.NodeData, bank != null ? bank.LazyBankFetch : null), "Undo Node Creation");
            OnRandomNode(parent);

            var child = CreateNode(parent.gameObject, parent, GUIDCreator.Create(), newNodeType);

            parent.FoldedOut = true;
            child.Name       = parent.Name + " Child";
            var data = AddDataClass(child);

            if (newNodeType == AudioNodeType.Folder)
            {
                (data as InFolderData).BankLink = parent.GetBank();
            }
            return(child);
        }
Example #8
0
        private static T CopyHierarchy <T>(T toCopy, T parent, Action <T, T> elementAction) where T : Component, InITreeNode <T>
        {
            T newNode = CopyComponent(toCopy);

            newNode.AssignParent(parent);
            newNode.ID = GUIDCreator.Create();

            if (elementAction != null)
            {
                elementAction(toCopy, newNode);
            }

            int childrenCount = newNode.GetChildren.Count;

            for (int i = 0; i < childrenCount; i++)
            {
                CopyHierarchy(newNode.GetChildren[i], newNode, elementAction);
            }
            newNode.GetChildren.RemoveRange(0, childrenCount);
            return(newNode);
        }
Example #9
0
        public static InAudioBus CreateTree(GameObject go)
        {
            var tree = CreateRoot(go, GUIDCreator.Create());

            return(tree);
        }