コード例 #1
0
    /// Loads a SoundBank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information.
    public static void LoadBankAsync(string name, AkCallbackManager.BankCallback callback = null)
    {
        BankHandle handle = null;

        lock (m_BankHandles)
        {
            if (m_BankHandles.TryGetValue(name, out handle))
            {
                // Bank already loaded, increment its ref count.
                handle.IncRef();
                return;
            }

            handle = new AsyncBankHandle(name, callback);
            m_BankHandles.Add(name, handle);
        }
        handle.LoadBank();
    }
コード例 #2
0
ファイル: AkBankManager.cs プロジェクト: EsbenNyboe/WwiseTest
    /// Loads a SoundBank. This version returns right away and loads in background. See AK::SoundEngine::LoadBank for more information.
    public static void LoadBankAsync(string name, AkCallbackManager.BankCallback callback = null)
    {
        m_Mutex.WaitOne();
        BankHandle handle = null;

        if (!m_BankHandles.TryGetValue(name, out handle))
        {
            AsyncBankHandle asyncHandle = new AsyncBankHandle(name, callback);
            m_BankHandles.Add(name, asyncHandle);
            m_Mutex.ReleaseMutex();
            asyncHandle.LoadBank();
        }
        else
        {
            // Bank already loaded, increment its ref count.
            handle.IncRef();
            m_Mutex.ReleaseMutex();
        }
    }