The Swartz-Manning’s first exhibit will provide a detailed history of Aaron Swartz Day. https://www.aaronswartzday.org/vr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EnumFlags.cs 903B

1234567891011121314151617181920212223242526272829303132
  1. //======= Copyright (c) Valve Corporation, All rights reserved. ===============
  2. //
  3. // Purpose: Allows Enums to be shown in the inspector as flags
  4. //
  5. //=============================================================================
  6. using UnityEngine;
  7. #if UNITY_EDITOR
  8. using UnityEditor;
  9. #endif
  10. namespace Valve.VR.InteractionSystem
  11. {
  12. //-------------------------------------------------------------------------
  13. public class EnumFlags : PropertyAttribute
  14. {
  15. public EnumFlags() { }
  16. }
  17. #if UNITY_EDITOR
  18. //-------------------------------------------------------------------------
  19. [CustomPropertyDrawer( typeof( EnumFlags ) )]
  20. public class EnumFlagsPropertyDrawer : PropertyDrawer
  21. {
  22. public override void OnGUI( Rect position, SerializedProperty property, GUIContent label )
  23. {
  24. property.intValue = EditorGUI.MaskField( position, label, property.intValue, property.enumNames );
  25. }
  26. }
  27. #endif
  28. }