MediaPlayerEditor_Events.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEngine;
  2. using UnityEditor;
  3. //-----------------------------------------------------------------------------
  4. // Copyright 2015-2021 RenderHeads Ltd. All rights reserved.
  5. //-----------------------------------------------------------------------------
  6. namespace RenderHeads.Media.AVProVideo.Editor
  7. {
  8. /// <summary>
  9. /// Editor for the MediaPlayer component
  10. /// </summary>
  11. public partial class MediaPlayerEditor : UnityEditor.Editor
  12. {
  13. private SerializedProperty _propEvents;
  14. private SerializedProperty _propEventMask;
  15. private SerializedProperty _propPauseMediaOnAppPause;
  16. private SerializedProperty _propPlayMediaOnAppUnpause;
  17. private void OnInspectorGUI_Events()
  18. {
  19. EditorGUILayout.BeginVertical(GUI.skin.box);
  20. EditorGUILayout.PropertyField(_propEvents);
  21. _propEventMask.intValue = EditorGUILayout.MaskField("Triggered Events", _propEventMask.intValue, System.Enum.GetNames(typeof(MediaPlayerEvent.EventType)));
  22. EditorGUILayout.BeginHorizontal();
  23. GUILayout.Label("Pause Media On App Pause");
  24. _propPauseMediaOnAppPause.boolValue = EditorGUILayout.Toggle(_propPauseMediaOnAppPause.boolValue);
  25. EditorGUILayout.EndHorizontal();
  26. EditorGUILayout.BeginHorizontal();
  27. GUILayout.Label("Play Media On App Unpause");
  28. _propPlayMediaOnAppUnpause.boolValue = EditorGUILayout.Toggle(_propPlayMediaOnAppUnpause.boolValue);
  29. EditorGUILayout.EndHorizontal();
  30. EditorGUILayout.EndVertical();
  31. }
  32. }
  33. }