예제 #1
0
    public AKRESULT PostOnEvent(uint in_eventID, GameObject in_gameObjectID, uint in_uNumPosts)
    {
        var in_gameObjectID_id = AkSoundEngine.GetAkGameObjectID(in_gameObjectID);

        AkSoundEngine.PreGameObjectAPICall(in_gameObjectID, in_gameObjectID_id);

        {
            return((AKRESULT)AkSoundEnginePINVOKE.CSharp_AkMIDIPost_PostOnEvent(swigCPtr, in_eventID,
                                                                                in_gameObjectID_id, in_uNumPosts));
        }
    }
예제 #2
0
    public uint PostOnEvent(uint in_eventID, UnityEngine.GameObject in_gameObjectID, uint in_uNumPosts)
    {
        var in_gameObjectID_id = AkSoundEngine.GetAkGameObjectID(in_gameObjectID);

        AkSoundEngine.PreGameObjectAPICall(in_gameObjectID, in_gameObjectID_id);

        uint ret = PostOnEvent(in_eventID, in_gameObjectID_id, in_uNumPosts);

        AkCallbackManager.SetLastAddedPlayingID(ret);
        return(ret);
    }
    public bool Add(UnityEngine.GameObject in_listenerGameObj, uint in_AuxBusID, float in_fValue)
    {
        if (isFull)
        {
            return(false);
        }

        AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_Set(GetObjectPtr(m_Count), AkSoundEngine.GetAkGameObjectID(in_listenerGameObj), in_AuxBusID, in_fValue);
        m_Count++;
        return(true);
    }
예제 #4
0
    public AKRESULT GetGameObjectAuxSendValues(GameObject in_gameObjectID, ref uint io_ruNumSendValues)
    {
        var in_gameObjectID_id = AkSoundEngine.GetAkGameObjectID(in_gameObjectID);

        AkSoundEngine.PreGameObjectAPICall(in_gameObjectID, in_gameObjectID_id);

        {
            return((AKRESULT)AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_GetGameObjectAuxSendValues(swigCPtr,
                                                                                                   in_gameObjectID_id, ref io_ruNumSendValues));
        }
    }
예제 #5
0
    public uint PostOnEvent(uint in_eventID, UnityEngine.GameObject in_gameObjectID, uint in_uNumPosts, bool in_bAbsoluteOffsets, uint in_uFlags, AkCallbackManager.EventCallback in_pfnCallback, object in_pCookie)
    {
        var in_gameObjectID_id = AkSoundEngine.GetAkGameObjectID(in_gameObjectID);

        AkSoundEngine.PreGameObjectAPICall(in_gameObjectID, in_gameObjectID_id);

        uint ret = PostOnEvent(in_eventID, in_gameObjectID_id, in_uNumPosts, in_bAbsoluteOffsets, in_uFlags, in_pfnCallback, in_pCookie);

        AkCallbackManager.SetLastAddedPlayingID(ret);
        return(ret);
    }
    private void Awake()
    {
        var akGameObj = GetComponent <AkGameObj>();

        UnityEngine.Debug.Assert(akGameObj != null);
        if (akGameObj)
        {
            akGameObj.Register();
        }

        akGameObjectID = AkSoundEngine.GetAkGameObjectID(gameObject);
    }
예제 #7
0
    private void OnEnableEditorListener()
    {
        if (!Application.isPlaying && AkSoundEngine.IsInitialized())
        {
            AkSoundEngine.RegisterGameObj(gameObject, gameObject.name);

            var id = AkSoundEngine.GetAkGameObjectID(gameObject);
            AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id);

            UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
        }
    }
    public bool IsSame(UnityEngine.GameObject listener, uint id)
    {
        var listener_id = AkSoundEngine.GetAkGameObjectID(listener);

        AkSoundEngine.PreGameObjectAPICall(listener, listener_id);

        {
            bool ret = AkSoundEnginePINVOKE.CSharp_AkAuxSendValueProxy_IsSame(swigCPtr, listener_id, id);

            return(ret);
        }
    }
예제 #9
0
    public void PostOnEvent(uint in_eventID, UnityEngine.GameObject gameObject, int count)
    {
        if (count >= m_Count)
        {
            throw new IndexOutOfRangeException("Out of range access in AkMIDIPostArray");
        }

        var gameObjectID = AkSoundEngine.GetAkGameObjectID(gameObject);

        AkSoundEngine.PreGameObjectAPICall(gameObject, gameObjectID);
        AkSoundEnginePINVOKE.CSharp_AkMIDIPost_PostOnEvent(m_Buffer, in_eventID, gameObjectID, (uint)count);
    }
예제 #10
0
    private void OnDisableEditorListener()
    {
        if (!Application.isPlaying && AkSoundEngine.IsInitialized())
        {
            UnityEditor.EditorApplication.update -= UpdateEditorListenerPosition;

            var id = AkSoundEngine.GetAkGameObjectID(gameObject);
            AkSoundEnginePINVOKE.CSharp_RemoveDefaultListener(id);

            AkSoundEngine.UnregisterGameObj(gameObject);
        }
    }
    private void OnEnableEditorListener(UnityEngine.GameObject gameObject)
    {
        if (!UnityEngine.Application.isPlaying && AkSoundEngine.IsInitialized() && editorListenerGameObject == null)
        {
            editorListenerGameObject = gameObject;

            AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name);

            // Do not create AkGameObj component when adding this listener
            var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);
            AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id);

            UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
        }
    }
    private void OnDisableEditorListener()
    {
        if (IsPlayingOrIsNotInitialized || editorListenerGameObject == null)
        {
            return;
        }

        UnityEditor.EditorApplication.update -= UpdateEditorListenerPosition;

        var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);

        AkSoundEnginePINVOKE.CSharp_RemoveDefaultListener(id);

        AkSoundEngine.UnregisterGameObj(editorListenerGameObject);
        editorListenerGameObject = null;
    }
예제 #13
0
    public bool Contains(UnityEngine.GameObject in_listenerGameObj, uint in_AuxBusID)
    {
        if (m_Buffer == IntPtr.Zero)
        {
            return(false);
        }

        for (int i = 0; i < m_Count; i++)
        {
            if (AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_IsSame(GetObjectPtr(i), AkSoundEngine.GetAkGameObjectID(in_listenerGameObj), in_AuxBusID))
            {
                return(true);
            }
        }

        return(false);
    }
    private void OnEnableEditorListener(UnityEngine.GameObject gameObject)
    {
        if (IsPlayingOrIsNotInitialized || editorListenerGameObject != null)
        {
            return;
        }

        editorListenerGameObject = gameObject;
        AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name);

        // Do not create AkGameObj component when adding this listener
        var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);

        AkSoundEngine.AddDefaultListener(id);

        UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
    }
    private void OnEnableEditorListener(UnityEngine.GameObject gameObject)
    {
        if (!UnityEngine.Application.isPlaying && AkSoundEngine.IsInitialized() && editorListenerGameObject == null)
        {
            editorListenerGameObject = gameObject;

            // Clearing the isDirty flag of the AkAudioListener list.
            AkAudioListener.DefaultListeners.Refresh();

            AkSoundEngine.RegisterGameObj(editorListenerGameObject, editorListenerGameObject.name);

            var id = AkSoundEngine.GetAkGameObjectID(editorListenerGameObject);
            AkSoundEnginePINVOKE.CSharp_AddDefaultListener(id);

            UnityEditor.EditorApplication.update += UpdateEditorListenerPosition;
        }
    }
예제 #16
0
    public AKRESULT GetValues(UnityEngine.GameObject gameObject)
    {
        uint     count = MAX_COUNT;
        AKRESULT res   = (AKRESULT)AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_GetGameObjectAuxSendValues(m_Buffer, AkSoundEngine.GetAkGameObjectID(gameObject), ref count);

        m_Count = (int)count;
        return(res);
    }
예제 #17
0
 public AKRESULT SetValues(UnityEngine.GameObject gameObject)
 {
     return((AKRESULT)AkSoundEnginePINVOKE.CSharp_AkAuxSendValue_SetGameObjectAuxSendValues(m_Buffer, AkSoundEngine.GetAkGameObjectID(gameObject), (uint)m_Count));
 }
예제 #18
0
 public void SetGameObjectRadius(float in_outerRadius, float in_innerRadius)
 {
     AkSoundEngine.SetGameObjectRadius(AkSoundEngine.GetAkGameObjectID(gameObject), in_outerRadius, in_innerRadius);
 }
예제 #19
0
 public void SetGameObjectRadius()
 {
     AkSoundEngine.SetGameObjectRadius(AkSoundEngine.GetAkGameObjectID(gameObject), outerRadius, innerRadius);
 }
예제 #20
0
 public void SetGameObjectRadius(UnityEngine.GameObject in_gameObject)
 {
     AkSoundEngine.SetGameObjectRadius(AkSoundEngine.GetAkGameObjectID(in_gameObject), outerRadius, innerRadius);
 }
예제 #21
0
 private void Awake()
 {
     akGameObjectID = AkSoundEngine.GetAkGameObjectID(gameObject);
     SetIsDefaultListener_NoCheck(isDefaultListener);
 }
예제 #22
0
 /// Access the room's ID
 public ulong GetID()
 {
     return(AkSoundEngine.GetAkGameObjectID(gameObject));
 }