Example #1
0
 //FMOD Error checking from return codes
 void ERRCHECK(FMOD.RESULT result)
 {
     if (result == FMOD.RESULT.ERR_INVALID_HANDLE)
     {
         Debug.LogError("FMOD_Unity: Event error: " + result +
                        ": have you set the MaxCallback on the event '" + m_source.getName() +
                        "' high enough ? (original FMOD message : " +
                        FMOD.Error.String(result) + ")");
         cleanInvalidHandle();
     }
     else if (result != FMOD.RESULT.OK)
     {
         Debug.LogError("FMOD_Unity: Event error: " + result + " - " + FMOD.Error.String(result));
     }
 }
Example #2
0
    public void releaseRunningInstance(FmodEventAudioSource runningSource)
    {
        if (runningSource != null && runningSource.getSource() != null)
        {
            FmodEvent evt = runningSource.getSource();

            if (m_eventPoolManager.eventPoolExists(evt) == false)
            {
                Debug.LogError("CRITICAL ERROR: No pool was created for event " + evt.getName());
            }
            else
            {
                m_eventPoolManager.getEventPool(evt).releaseRunningInstance(runningSource);
            }
        }
    }
    private void _SetupDragAndDrop(FmodEventAsset asset)
    {
        Event e = Event.current;

        if (e.type == EventType.MouseUp || e.type == EventType.MouseDown)
        {
            _clearDragAndDrop();
        }
        if (e.type == EventType.MouseDrag)
        {
            FmodEvent  fmodEvent = _getHoveredEvent();
            FmodReverb reverb    = _getHoveredReverb();

            if (fmodEvent != null)
            {
                DragAndDrop.PrepareStartDrag();
                DragAndDrop.paths            = new string[0];
                DragAndDrop.objectReferences = new Object[1] {
                    fmodEvent
                };
                DragAndDrop.SetGenericData(ONGOING_DRAG_KEY, true);
                DragAndDrop.SetGenericData(SOURCE_ASSET_KEY, asset);
                DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
                DragAndDrop.StartDrag("Creating sound from event '" + fmodEvent.getName() + "'");
                m_ongoingDrag = true;
                e.Use();
            }
            else if (reverb != null)
            {
                DragAndDrop.PrepareStartDrag();
                DragAndDrop.paths            = new string[0];
                DragAndDrop.objectReferences = new Object[1] {
                    reverb
                };
                DragAndDrop.SetGenericData(ONGOING_DRAG_KEY, true);
                DragAndDrop.SetGenericData(SOURCE_ASSET_KEY, asset);
                DragAndDrop.visualMode = DragAndDropVisualMode.Move;
                DragAndDrop.StartDrag("Creating reverb zone from reverb '" + reverb.getName() + "'");
                m_ongoingDrag = true;
                e.Use();
            }
        }
    }
Example #4
0
 private string getErrorPrefix()
 {
     return("FMOD_Unity: FmodEventPool(" + m_event.getName() + ") : ");
 }