GUIMixedValueScope.cs 424 B

1234567891011121314151617181920
  1. using System;
  2. using UnityEngine;
  3. namespace UnityEditor
  4. {
  5. struct GUIMixedValueScope : IDisposable
  6. {
  7. readonly bool m_PrevValue;
  8. public GUIMixedValueScope(bool newValue)
  9. {
  10. m_PrevValue = EditorGUI.showMixedValue;
  11. EditorGUI.showMixedValue = newValue;
  12. }
  13. public void Dispose()
  14. {
  15. EditorGUI.showMixedValue = m_PrevValue;
  16. }
  17. }
  18. }