Esempio n. 1
0
        //TODO MUSICUPDATE
        public static void RebuildBanks()
        {
            InAudioBankLink rootBank  = InAudioInstanceFinder.DataManager.BankLinkTree;
            InAudioNode     audioRoot = InAudioInstanceFinder.DataManager.AudioTree;
            InMusicNode     musicRoot = InAudioInstanceFinder.DataManager.MusicTree;

            TreeWalker.ForEach(rootBank, DeleteAllNodesFromBanks);

            TreeWalker.ForEach(audioRoot, node =>
            {
                var folderData = node._nodeData as InFolderData;
                SetBankIfNotNull(folderData, rootBank);
            });
            TreeWalker.ForEach(musicRoot, node =>
            {
                var folderData = node as InMusicFolder;
                SetBankIfNotNull(folderData, rootBank);
            });

            TreeWalker.ForEach(audioRoot, AddNodesToBank);
            TreeWalker.ForEach(musicRoot, AddNodesToBank);

            //Set the bank of the root node if it is missing
            InFolderData inFolderData = audioRoot._nodeData as InFolderData;

            if (inFolderData != null && inFolderData.BankLink == null)
            {
                inFolderData.BankLink = TreeWalker.FindFirst(rootBank, link => link._type == AudioBankTypes.Bank);
            }
            if (inFolderData.BankLink != null)
            {
                TreeWalker.ForEach(audioRoot, SetBanks);
            }
        }
Esempio n. 2
0
        public static void ChangeBankOverride(InAudioNode node)
        {
            var all = GetAllBanks();

            InUndoHelper.RecordObject(all.ToArray().AddObj(node._nodeData), "Changed Bank");
            InFolderData data = (node._nodeData as InFolderData);

            data.OverrideParentBank = !data.OverrideParentBank;
            RebuildBanks();
        }
Esempio n. 3
0
        public static void ChangeAudioNodeBank(InAudioNode node, InAudioBankLink newBank)
        {
            var all = GetAllBanks();

            InUndoHelper.RecordObject(all.ToArray().AddObj(node._nodeData), "Changed Bank");
            InFolderData data = (node._nodeData as InFolderData);

            data.BankLink = newBank;
            RebuildBanks();
        }
Esempio n. 4
0
 private static void SetBanks(InAudioNode node)
 {
     if (node.IsRootOrFolder)
     {
         InFolderData inFolderData = (node._nodeData as InFolderData);
         if (inFolderData != null)
         {
             if (inFolderData.BankLink == null)
             {
                 inFolderData.BankLink = node.GetBank();
             }
         }
     }
 }
        public static void DrawVolume(Rect fullArea, InFolderData @group)
        {
            if (group == null)
            {
                return;
            }
            GUI.enabled = false;
            Rect sliderRect = fullArea;

            sliderRect.x       = sliderRect.width - 30;
            sliderRect.width   = 20;
            sliderRect.height -= 5;

            GUI.VerticalSlider(sliderRect, @group.hiearchyVolume, 1f, 0f);

            GUI.enabled = true;
        }
Esempio n. 6
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);
        }