mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 01:40:06 +00:00
3.0 - unitypackage
This commit is contained in:
51
Editor/Widgets/XCProgressBarEditor.cs
Normal file
51
Editor/Widgets/XCProgressBarEditor.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
using UnityEditor;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomEditor(typeof(XCProgressBar), false)]
|
||||
public class XCProgressBarEditor : UnityEditor.Editor
|
||||
{
|
||||
|
||||
[MenuItem("XCharts/ProgressBar", priority = 200)]
|
||||
[MenuItem("GameObject/XCharts/ProgressBar", priority = 200)]
|
||||
public static void AddPyramidChart()
|
||||
{
|
||||
XChartsEditor.AddChart<XCProgressBar>("ProgressBar");
|
||||
}
|
||||
|
||||
protected SerializedProperty m_Script;
|
||||
protected SerializedProperty m_Value;
|
||||
protected SerializedProperty m_BackgroundColor;
|
||||
protected SerializedProperty m_StartColor;
|
||||
protected SerializedProperty m_EndColor;
|
||||
protected SerializedProperty m_CornerRadius;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
m_Script = serializedObject.FindProperty("m_Script");
|
||||
m_Value = serializedObject.FindProperty("m_Value");
|
||||
m_BackgroundColor = serializedObject.FindProperty("m_BackgroundColor");
|
||||
m_StartColor = serializedObject.FindProperty("m_StartColor");
|
||||
m_EndColor = serializedObject.FindProperty("m_EndColor");
|
||||
m_CornerRadius = serializedObject.FindProperty("m_CornerRadius");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
OnStartInspectorGUI();
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
protected virtual void OnStartInspectorGUI()
|
||||
{
|
||||
EditorGUILayout.PropertyField(m_Script);
|
||||
EditorGUILayout.PropertyField(m_BackgroundColor);
|
||||
EditorGUILayout.PropertyField(m_StartColor);
|
||||
EditorGUILayout.PropertyField(m_EndColor);
|
||||
EditorGUILayout.PropertyField(m_Value);
|
||||
EditorGUILayout.PropertyField(m_CornerRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/Widgets/XCProgressBarEditor.cs.meta
Normal file
11
Editor/Widgets/XCProgressBarEditor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17cd5e3604edc43e5b7b6bfc3c71857b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user