Example Result | . |
---|---|
. |
Usage example:
using UnityEngine;
public class MyMonoClass : MonoBehaviour
{
public void Call_a_func()
{
Debug.Log("Exec");
}
}
#if UNITY_EDITOR
namespace UnityEditorScope
{
using UnityEditor;
[CustomEditor( typeof( MyMonoClass ) )]
class GrassSpawnerEditor : EditorSceneGUIOverlay
{
void OnSceneGUI( ) => SceneGUIOverlay();
public override void Draw( )
{
float val_min = 2f;
float val_max = 5f;
EditorGUILayout.MinMaxSlider( ref val_min, ref val_max, 0, 10f );
GUILayout.Label("Label: ");
EditorGUILayout.FloatField( 0.2f );
if( GUILayout.Button("Exec") )
{
( ( MyMonoClass ) target ).Call_a_func();
}
}
}
}
#endif