CaptureFromTextureEditor.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. using UnityEditor;
  4. //-----------------------------------------------------------------------------
  5. // Copyright 2012-2022 RenderHeads Ltd. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. namespace RenderHeads.Media.AVProMovieCapture.Editor
  8. {
  9. [CanEditMultipleObjects]
  10. [CustomEditor(typeof(CaptureFromTexture))]
  11. public class CaptureFromTextureEditor : CaptureBaseEditor
  12. {
  13. private SerializedProperty _propManualUpdate;
  14. protected override void OnEnable()
  15. {
  16. base.OnEnable();
  17. _propManualUpdate = serializedObject.AssertFindProperty("_manualUpdate");
  18. }
  19. protected void GUI_Camera()
  20. {
  21. EditorGUILayout.PropertyField(_propManualUpdate);
  22. }
  23. protected override void GUI_User()
  24. {
  25. if (_baseCapture != null && !_baseCapture.IsCapturing())
  26. {
  27. serializedObject.Update();
  28. bool boolTrue = true;
  29. EditorUtils.DrawSection("Capture From Texture", ref boolTrue, GUI_Camera);
  30. if (serializedObject.ApplyModifiedProperties())
  31. {
  32. EditorUtility.SetDirty(target);
  33. }
  34. }
  35. }
  36. }
  37. }
  38. #endif