작업 조건 분석 기능 개발
This commit is contained in:
35
Assets/Chart And Graph/Editor/ItemLabelsBaseEditor.cs
Normal file
35
Assets/Chart And Graph/Editor/ItemLabelsBaseEditor.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#define Graph_And_Chart_PRO
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
|
||||
namespace ChartAndGraph
|
||||
{
|
||||
abstract class ItemLabelsBaseEditor : Editor
|
||||
{
|
||||
protected abstract string Name { get; }
|
||||
protected abstract bool isSupported(AnyChart chart);
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
|
||||
|
||||
ItemLabelsBase labels = (ItemLabelsBase)target;
|
||||
|
||||
if (labels.gameObject == null)
|
||||
return;
|
||||
|
||||
AnyChart chart = labels.gameObject.GetComponent<AnyChart>();
|
||||
if (chart == null)
|
||||
return;
|
||||
if (isSupported(chart) == false)
|
||||
{
|
||||
EditorGUILayout.HelpBox(string.Format("Chart of type {0} does not support {1}", chart.GetType().Name,Name),MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user