Exemple #1
0
        static void eventCallback(Event e, global::System.IntPtr userData)
        {
            GCHandle        gch = GCHandle.FromIntPtr(userData);
            SpatDecoderFile sf  = (SpatDecoderFile)gch.Target;

            sf.events.onNewEvent(e);
        }
        public override void OnInspectorGUI()
        {
            SpatDecoderFile sp = (SpatDecoderFile)target;

            serializedObject.Update();
            EditorGUILayout.Space();

            EditorGUILayout.PropertyField(file, new GUIContent("File"));
            EditorGUILayout.PropertyField(playOnStart, new GUIContent("Play On Start"));
            EditorGUILayout.PropertyField(loop, new GUIContent("Loop"));
            EditorGUILayout.Slider(volume, 0.0f, 1.5f, "Volume");
            EditorGUILayout.PropertyField(useObjectRotation, new GUIContent("Use Object Rotation", "Use the GameObject's rotation to rotate the ambisonic field"));
            EditorGUILayout.PropertyField(syncMode, new GUIContent("Sync Mode"));
            EditorGUILayout.PropertyField(focus, new GUIContent("Focus"));

            EditorGUI.BeginDisabledGroup(!sp.focus);
            EditorGUI.indentLevel = 1;
            EditorGUILayout.Slider(offFocusLeveldB, Utils.kFocusMin, Utils.kFocusMax, "Off-Focus Level (dB)");
            EditorGUILayout.Slider(focusWidth, Utils.kFocusWidthMin, Utils.kFocusWidthMax, "Focus Width (deg)");

            EditorGUI.indentLevel = 0;
            EditorGUI.EndDisabledGroup();

            serializedObject.ApplyModifiedProperties();
            if (Application.isPlaying)
            {
                sp.updateProps();
            }
        }