天津23维预案
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.
 
 
 
 
 
 

49 lines
1003 B

using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System;
namespace UIWidgets
{
public class TileViewEditor : Editor
{
protected Dictionary<string,SerializedProperty> SerializedProperties = new Dictionary<string,SerializedProperty>();
protected List<string> Properties = new List<string>{
"customItems",
"Multiple",
"selectedIndex",
"direction",
"DefaultItem",
"Container",
"scrollRect",
"defaultColor",
"defaultBackgroundColor",
"HighlightedColor",
"HighlightedBackgroundColor",
"selectedColor",
"selectedBackgroundColor",
};
protected virtual void OnEnable()
{
Properties.ForEach(x => {
SerializedProperties.Add(x, serializedObject.FindProperty(x));
});
}
public override void OnInspectorGUI()
{
serializedObject.Update();
SerializedProperties.ForEach(x => EditorGUILayout.PropertyField(x.Value, true));
serializedObject.ApplyModifiedProperties();
}
}
}