public static InAudioBankLink CreateBank(GameObject go, InAudioBankLink parent, int guid) { InAudioBankLink link = CreateBankLink(go, parent, guid); SaveAndLoad.CreateAudioBank(guid); return(link); }
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); }
public static InAudioBank LoadBank(InAudioBankLink bankLink) { if (bankLink == null) { return(null); } return(SaveAndLoad.LoadAudioBank(bankLink.ID)); }
private static void CreateIfMissing(InAudioBankLink bankLink) { if (bankLink != null && bankLink.Type == AudioBankTypes.Link) { bankLink.LoadedBank = BankLoader.LoadBank(bankLink); if (bankLink.LoadedBank == null) { GameObject go = BankLoader.GetBankGO(bankLink.ID); if (go == null) { SaveAndLoad.CreateAudioBank(bankLink.ID); Debug.Log("Created missing Bank " + bankLink.Name + " with id " + bankLink.ID); } else { var bank = go.AddComponent <InAudioBank>(); bank.GUID = bankLink.ID; Debug.Log("Created missing Bank \n" + bankLink.Name + "\n with id " + bankLink.ID); } } } }