31 lines
904 B
C#
31 lines
904 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
[CustomEditor(typeof(digits_sheet_auto))]
|
|
public class digits_sheet_autoEditor : Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
serializedObject.Update();
|
|
|
|
SerializedProperty prop = serializedObject.GetIterator();
|
|
bool enterChildren = true;
|
|
|
|
while (prop.NextVisible(enterChildren))
|
|
{
|
|
enterChildren = false;
|
|
if (prop.name == "m_Script")
|
|
continue;
|
|
|
|
if (prop.name == "showComma")
|
|
EditorGUILayout.PropertyField(prop, new GUIContent("显示逗号‘,’"));
|
|
else if (prop.name == "decimalPlaces")
|
|
EditorGUILayout.PropertyField(prop, new GUIContent("保留小数点位数"));
|
|
else
|
|
EditorGUILayout.PropertyField(prop, true);
|
|
}
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
}
|