MediaPlayerEditor_WebGL.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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 readonly static FieldDescription _optionExternalLibrary = new FieldDescription(".externalLibrary", GUIContent.none);
  14. private void OnInspectorGUI_Override_WebGL()
  15. {
  16. GUILayout.Space(8f);
  17. string optionsVarName = MediaPlayer.GetPlatformOptionsVariable(Platform.WebGL);
  18. EditorGUILayout.BeginVertical(GUI.skin.box);
  19. DisplayPlatformOption(optionsVarName, _optionExternalLibrary);
  20. SerializedProperty propUseTextureMips = DisplayPlatformOption(optionsVarName, _optionTextureMips);
  21. if (propUseTextureMips.boolValue && ((FilterMode)_propFilter.enumValueIndex) != FilterMode.Trilinear)
  22. {
  23. EditorHelper.IMGUI.NoticeBox(MessageType.Info, "Recommend changing the texture filtering mode to Trilinear when using mip-maps.");
  24. }
  25. EditorGUILayout.EndVertical();
  26. }
  27. }
  28. }