private void OnEnable() { Debug.Log("adadadada"); ///Check if a bus data exist and take her data string[] currentFile = AssetDatabase.FindAssets("t:" + typeof(FmodBus).FullName); if (currentFile.Length > 0) { ///Take the first element path found string currentPath = AssetDatabase.GUIDToAssetPath(currentFile[0]); ///take the data reference m_fmodBus = AssetDatabase.LoadAssetAtPath <FmodBus>(currentPath); ///Update path with current m_datapath = currentPath.Replace(m_fileName, ""); ///update and Save playerpref PlayerPrefs.SetString(dataPathPref, m_datapath); PlayerPrefs.Save(); ///Initialize BusData // m_fmodBus.Init(m_datapath); EditorUtility.SetDirty(m_fmodBus); } else { m_datapath = PlayerPrefs.GetString(dataPathPref, ""); m_fmodBus = null; } }
///Called to create and show bus data private void Init() { if (m_fmodBus == null) { if (AssetDatabase.IsValidFolder(m_datapath)) { m_fmodBus = ScriptableObject.CreateInstance <FmodBus>(); string _uniquePath = AssetDatabase.GenerateUniqueAssetPath(m_datapath + "/" + m_fileName); AssetDatabase.CreateAsset(m_fmodBus, _uniquePath); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } else { Debug.LogError("Path dosen't exist"); } m_fmodBus.Init(m_datapath); } else { m_fmodBus.Init(m_datapath); } EditorUtility.SetDirty(m_fmodBus); }
public void UnlockChannelGroup() { FmodBus.unlockChannelGroup().Check(); }
public void LockChannelGroup() { FmodBus.lockChannelGroup().Check(); }
public void StopAllEvents(bool allowFadeout) { FmodBus.stopAllEvents(allowFadeout ? STOP_MODE.ALLOWFADEOUT : STOP_MODE.IMMEDIATE).Check(Util.SuppressInvalidHandle); }