multiple xr toolkit package
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.

VRC_AvatarVariationsEditor.cs 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. namespace VRCSDK2
  6. {
  7. //[CustomPropertyDrawer(typeof(VRC_AvatarVariations.VariationCategory))]
  8. //public class PropertyDrawer_AvatarVariation_VariationCategory : PropertyDrawer
  9. //{
  10. // public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
  11. // {
  12. // //EditorGUILayout.Label("blah");
  13. // if (property == null)
  14. // return;
  15. // SerializedProperty nameProperty = property.FindPropertyRelative("name");
  16. // //SerializedProperty mirrorProperty = property.FindPropertyRelative("mirror");
  17. // //SerializedProperty typeProperty = property.FindPropertyRelative("type");
  18. // //SerializedProperty valueProperty = null;
  19. // //switch (typeProperty.enumValueIndex)
  20. // //{
  21. // // case (int)VRC_DataStorage.VrcDataType.Bool:
  22. // // valueProperty = property.FindPropertyRelative("valueBool");
  23. // // break;
  24. // // case (int)VRC_DataStorage.VrcDataType.Float:
  25. // // valueProperty = property.FindPropertyRelative("valueFloat");
  26. // // break;
  27. // // case (int)VRC_DataStorage.VrcDataType.Int:
  28. // // valueProperty = property.FindPropertyRelative("valueInt");
  29. // // break;
  30. // // case (int)VRC_DataStorage.VrcDataType.String:
  31. // // valueProperty = property.FindPropertyRelative("valueString");
  32. // // break;
  33. // // case (int)VRC_DataStorage.VrcDataType.SerializeObject:
  34. // // valueProperty = property.FindPropertyRelative("serializeComponent");
  35. // // break;
  36. // // case (int)VRC_DataStorage.VrcDataType.None:
  37. // // case (int)VRC_DataStorage.VrcDataType.SerializeBytes:
  38. // // break;
  39. // //}
  40. // EditorGUI.BeginProperty(rect, label, property);
  41. // int baseWidth = (int)(rect.width / 4);
  42. // Rect nameRect = new Rect(rect.x, rect.y, baseWidth, rect.height);
  43. // //Rect mirrorRect = new Rect(rect.x + baseWidth, rect.y, baseWidth, rect.height);
  44. // //Rect typeRect = new Rect(rect.x + baseWidth * 2, rect.y, baseWidth, rect.height);
  45. // //Rect valueRect = new Rect(rect.x + baseWidth * 3, rect.y, baseWidth, rect.height);
  46. // //Rect typeValueRect = new Rect(rect.x + baseWidth * 2, rect.y, baseWidth * 2, rect.height);
  47. // EditorGUI.PropertyField(nameRect, nameProperty, GUIContent.none);
  48. // //EditorGUI.PropertyField(mirrorRect, mirrorProperty, GUIContent.none);
  49. // //switch (mirrorProperty.enumValueIndex)
  50. // //{
  51. // // case (int)VRC_DataStorage.VrcDataMirror.None:
  52. // // if (valueProperty == null)
  53. // // VRC_EditorTools.FilteredEnumPopup<VRC_DataStorage.VrcDataType>(typeValueRect, typeProperty, t => true);
  54. // // else
  55. // // {
  56. // // VRC_EditorTools.FilteredEnumPopup<VRC_DataStorage.VrcDataType>(typeRect, typeProperty, t => true);
  57. // // EditorGUI.PropertyField(valueRect, valueProperty, GUIContent.none);
  58. // // }
  59. // // break;
  60. // // case (int)VRC_DataStorage.VrcDataMirror.SerializeComponent:
  61. // // typeProperty.enumValueIndex = (int)VRC_DataStorage.VrcDataType.SerializeObject;
  62. // // EditorGUI.PropertyField(typeValueRect, valueProperty, GUIContent.none);
  63. // // break;
  64. // // default:
  65. // // VRC_EditorTools.FilteredEnumPopup<VRC_DataStorage.VrcDataType>(typeValueRect, typeProperty, t => true);
  66. // // break;
  67. // //}
  68. // EditorGUI.EndProperty();
  69. // }
  70. //}
  71. //[CustomEditor(typeof(VRC_AvatarVariations))]
  72. //public class VRC_AvatarVariationsEditor : Editor
  73. //{
  74. // SerializedProperty categories;
  75. // void OnEnable()
  76. // {
  77. // categories = serializedObject.FindProperty("categories");
  78. // }
  79. // public override void OnInspectorGUI()
  80. // {
  81. // //serializedObject.Update();
  82. // // EditorGUILayout.PropertyField(categories);
  83. // //serializedObject.ApplyModifiedProperties();
  84. // //if (target == null)
  85. // // return;
  86. // ////var prop = serializedObject.FindProperty("root");
  87. // ////EditorGUILayout.PropertyField(prop, new GUIContent("Show Help"));
  88. // //VRCSDK2.VRC_AvatarVariations variations = target as VRCSDK2.VRC_AvatarVariations;
  89. // //if (variations.categories == null)
  90. // // variations.categories = new VRC_AvatarVariations.VariationCategory[0];
  91. // //foreach ( var vc in variations.categories )
  92. // //{
  93. // // vc.name = EditorGUILayout.TextField("Variation Name", vc.name);
  94. // //// SerializedProperty triggers = triggersProperty.Copy();
  95. // //// int triggersLength = triggers.arraySize;
  96. // //// List<int> to_remove = new List<int>();
  97. // //// for (int idx = 0; idx < triggersLength; ++idx)
  98. // //// {
  99. // //// SerializedProperty triggerProperty = triggers.GetArrayElementAtIndex(idx);
  100. // //// }
  101. // //// EditorGUILayout.LabelField("");
  102. // ////// helpProperty = serializedObject.FindProperty("ShowHelp");
  103. // ////// EditorGUILayout.PropertyField(helpProperty, new GUIContent("Show Help"));
  104. // //}
  105. // ////EditorGUILayout.
  106. // DrawDefaultInspector();
  107. // }
  108. //}
  109. }