public void OnEnable()
 {
     eventPlayable = target as FMODEventPlayable;
     if (eventPlayable && !string.IsNullOrEmpty(eventPlayable.eventName))
     {
         editorEventRef = EventManager.EventFromPath(eventPlayable.eventName);
         eventPlayable.UpdateEventDuration(editorEventRef.IsOneShot ? editorEventRef.Length : float.PositiveInfinity);
     }
 }
Beispiel #2
0
        public void OnSceneGUI()
        {
            var audioObject = target as AudioObject;

            string path = audioObject.currentAttenuationToDraw;

            if (string.IsNullOrEmpty(path))
            {
                return;
            }
            EditorEventRef editorEvent = EventManager.EventFromPath(path);

            if (editorEvent != null && editorEvent.Is3D)
            {
                float minDistance = editorEvent.MinDistance;
                float maxDistance = editorEvent.MaxDistance;
                Handles.RadiusHandle(Quaternion.identity, audioObject.transform.position, minDistance);
                Handles.RadiusHandle(Quaternion.identity, audioObject.transform.position, maxDistance);
            }
        }