public static InAudioNode CreateChild(GameObject go, InAudioNode parent, AudioNodeType newNodeType) { InUndoHelper.RecordObject(InUndoHelper.Array(parent).Concat(parent.GetAuxData()).ToArray(), "Undo Node Creation"); OnRandomNode(parent); var child = CreateNode(go, parent, GUIDCreator.Create(), newNodeType); parent.EditorSettings.IsFoldedOut = true; child.Name = parent.Name + " Child"; AddDataClass(child); return(child); }
public static InAudioNode CreateChild(GameObject go, InAudioNode parent, AudioNodeType newNodeType) { var bank = parent.GetBank(); InUndoHelper.RecordObject(InUndoHelper.Array(parent, bank).Concat(parent.GetAuxData()).ToArray(), "Undo Node Creation"); OnRandomNode(parent); var child = CreateNode(go, 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); }
public static InAudioNode CreateChild(GameObject go, InAudioNode parent, AudioNodeType newNodeType) { var bank = parent.GetBank(); InUndoHelper.RecordObject(InUndoHelper.Array(parent, bank).Concat(parent.GetAuxData()).ToArray(), "Undo Node Creation"); OnRandomNode(parent); var child = CreateNode(go, 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; }