예제 #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
    /// 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();
        }
    }
예제 #3
0
    /// Loads a SoundBank. This version blocks until the bank is loaded. See AK::SoundEngine::LoadBank for more information.
    public static void LoadBank(string name, bool decodeBank, bool saveDecodedBank)
    {
#if UNITY_SWITCH
        // No bank decoding on Nintendo switch
        decodeBank = false;
#endif

        m_Mutex.WaitOne();
        BankHandle handle = null;
        if (!m_BankHandles.TryGetValue(name, out handle))
        {
            handle = decodeBank ? new DecodableBankHandle(name, saveDecodedBank) : new BankHandle(name);
            m_BankHandles.Add(name, handle);
            m_Mutex.ReleaseMutex();
            handle.LoadBank();
        }
        else
        {
            // Bank already loaded, increment its ref count.
            handle.IncRef();
            m_Mutex.ReleaseMutex();
        }
    }
예제 #4
0
    /// Loads a SoundBank. This version blocks until the bank is loaded. See AK::SoundEngine::LoadBank for more information.
    public static void LoadBank(string name, bool decodeBank, bool saveDecodedBank)
    {
        BankHandle handle = null;

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

#if UNITY_SWITCH
            // No bank decoding on Nintendo switch
            handle = new BankHandle(name);
#else
            handle = decodeBank ? new DecodableBankHandle(name, saveDecodedBank) : new BankHandle(name);
#endif
            m_BankHandles.Add(name, handle);
        }
        handle.LoadBank();
    }