64 lines
2.6 KiB
C#
64 lines
2.6 KiB
C#
|
using System;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEditor;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
[CustomEditor(typeof(ChartTool))]
|
|||
|
public class ChartToolEX : Editor
|
|||
|
{
|
|||
|
ChartTool ct;
|
|||
|
GUILayoutOption[] Options = new GUILayoutOption[] { GUILayout.Width(100f)};
|
|||
|
|
|||
|
public override void OnInspectorGUI()
|
|||
|
{
|
|||
|
ct = (ChartTool)target;
|
|||
|
|
|||
|
GUILayout.BeginVertical();
|
|||
|
for (int i = 0; i < ct.SerieUrl.Count; i++)
|
|||
|
{
|
|||
|
GUILayout.BeginVertical("Box");
|
|||
|
GUILayout.BeginHorizontal();
|
|||
|
EditorGUILayout.LabelField("<22><><EFBFBD><EFBFBD>:", new GUILayoutOption[] { GUILayout.Width(30f) });
|
|||
|
ct.SerieUrl[i].type = (UIType)EditorGUILayout.EnumFlagsField(ct.SerieUrl[i].type, Options);
|
|||
|
EditorGUILayout.LabelField("<22>㼶:", new GUILayoutOption[] { GUILayout.Width(30f) });
|
|||
|
ct.SerieUrl[i].index = EditorGUILayout.IntField(ct.SerieUrl[i].index, Options);
|
|||
|
EditorGUILayout.LabelField("<22><>Դ:", new GUILayoutOption[] { GUILayout.Width(30f) });
|
|||
|
ct.SerieUrl[i].url = EditorGUILayout.TextField(ct.SerieUrl[i].url, Options);
|
|||
|
if (ct.SerieUrl[i].type != UIType.Pie)
|
|||
|
{
|
|||
|
if (GUILayout.Button("-", new GUILayoutOption[] { GUILayout.Width(20f) }))
|
|||
|
{
|
|||
|
ct.SerieUrl.Remove(ct.SerieUrl[i]);
|
|||
|
}
|
|||
|
}
|
|||
|
GUILayout.EndHorizontal();
|
|||
|
|
|||
|
if (ct.SerieUrl[i].type == UIType.Pie || ct.SerieUrl[i].type == UIType.Ring)
|
|||
|
{
|
|||
|
GUILayout.BeginHorizontal();
|
|||
|
EditorGUILayout.LabelField("<22><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>:", new GUILayoutOption[] { GUILayout.Width(60f) });
|
|||
|
ct.SerieUrl[i].plan = EditorGUILayout.IntField(ct.SerieUrl[i].plan, Options);
|
|||
|
EditorGUILayout.LabelField("<22><>ʾUI:", new GUILayoutOption[] { GUILayout.Width(40f) });
|
|||
|
ct.SerieUrl[i].text = (Text)EditorGUILayout.ObjectField(ct.SerieUrl[i].text, typeof(Text), true);
|
|||
|
EditorGUILayout.LabelField("<22><>ʽ:", new GUILayoutOption[] { GUILayout.Width(30f) });
|
|||
|
ct.SerieUrl[i].format = EditorGUILayout.TextField(ct.SerieUrl[i].format, Options);
|
|||
|
if (GUILayout.Button("-", new GUILayoutOption[] { GUILayout.Width(20f) }))
|
|||
|
{
|
|||
|
ct.SerieUrl.Remove(ct.SerieUrl[i]);
|
|||
|
}
|
|||
|
GUILayout.EndHorizontal();
|
|||
|
}
|
|||
|
GUILayout.EndVertical();
|
|||
|
}
|
|||
|
|
|||
|
if (GUILayout.Button("+", new GUILayoutOption[] { GUILayout.Width(20f) }))
|
|||
|
{
|
|||
|
ct.SerieUrl.Add(new Chart(0,0,"",0,"f0"));
|
|||
|
}
|
|||
|
|
|||
|
GUILayout.EndVertical();
|
|||
|
}
|
|||
|
}
|