123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEditor;
- namespace EZXR.Glass.UI
- {
- [CustomEditor(typeof(SpatialButton_Normal))]
- [CanEditMultipleObjects]
- public class SpatialButtonNormalInspector : SpatialButtonInspector
- {
- private SpatialButton_Normal _target_SpatialButtonNormal;
- SerializedProperty transition;
- //SerializedProperty normalTexture;
- SerializedProperty hoverTexture;
- SerializedProperty pressedTexture;
- SerializedProperty disabledTexture;
- //SerializedProperty normalColor;
- SerializedProperty hoverColor;
- SerializedProperty pressedColor;
- SerializedProperty disabledColor;
- //SerializedProperty positionType;
- //SerializedProperty size;
- //SerializedProperty text;
- //SerializedProperty pressed;
- ////SerializedProperty defaultMaterial;
- ////SerializedProperty sharedMaterial;
- //SerializedProperty color;
- //SerializedProperty texture;
- //SerializedProperty preTriggerZoneThickness;
- //SerializedProperty rearTriggerZoneThickness;
- //SerializedProperty states;
- //SerializedProperty clicked;
- //SerializedProperty sortingOrder;
- protected override void OnEnable()
- {
- base.OnEnable();
- _target_SpatialButtonNormal = target as SpatialButton_Normal;
- transition = serializedObject.FindProperty("transition");
- //normalTexture = serializedObject.FindProperty("normalTexture");
- hoverTexture = serializedObject.FindProperty("hoverTexture");
- pressedTexture = serializedObject.FindProperty("pressedTexture");
- disabledTexture = serializedObject.FindProperty("disabledTexture");
- //normalColor = serializedObject.FindProperty("normalColor");
- hoverColor = serializedObject.FindProperty("hoverColor");
- pressedColor = serializedObject.FindProperty("pressedColor");
- disabledColor = serializedObject.FindProperty("disabledColor");
- }
- public override void OnInspectorGUI()
- {
- base.OnInspectorGUI();
- serializedObject.Update();
- EditorGUILayout.PropertyField(transition);
- switch (_target_SpatialButtonNormal.transition)
- {
- case SpatialButton_Normal.Transition.TextureSwap:
- EditorGUILayout.BeginHorizontal();
- {
- EditorGUILayout.Space(10, false);
- EditorGUILayout.BeginVertical();
- {
- //EditorGUILayout.PropertyField(normalTexture);
- EditorGUILayout.PropertyField(hoverTexture);
- EditorGUILayout.PropertyField(pressedTexture);
- EditorGUILayout.PropertyField(disabledTexture);
- }
- EditorGUILayout.EndVertical();
- }
- EditorGUILayout.EndHorizontal();
- break;
- case SpatialButton_Normal.Transition.ColorTint:
- EditorGUILayout.BeginHorizontal();
- {
- EditorGUILayout.Space(10, false);
- EditorGUILayout.BeginVertical();
- {
- //EditorGUILayout.PropertyField(normalColor);
- EditorGUILayout.PropertyField(hoverColor);
- EditorGUILayout.PropertyField(pressedColor);
- EditorGUILayout.PropertyField(disabledColor);
- }
- EditorGUILayout.EndVertical();
- }
- EditorGUILayout.EndHorizontal();
- break;
- }
- serializedObject.ApplyModifiedProperties();
- SceneView.RepaintAll();
- }
- }
- }
|