In Unity3d
- go Window > Package Manager > '+'(left above) > Add packaga from git URL...
- paste url : https://github.com/geniikw/MonoInvoker.git
- In monobehaviour class, add [TestMethod] above method. you want simply call.
- now you can see method call interface in inspector.
- add list parameter.
- serialize parameter values.
- implement package manager compatibility.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MonoInvokerSample : MonoBehaviour
{
[TestMethod]
void Move(float x)
{
transform.Translate(x,0,0);
}
}
1.You can write parameter like [TestMethod(false)], if you dont want play in editor mode. basically, if a method contains StartCoroutine, it doent work in editor mode.
2.If you use custom editor. editor class have to inherit MonoInvoker.MonoBehaviourEditor not UnityEditor.Editor.
//part of EditorClass
[CustomEditor (typeof (Tester), true)]
public class TestEditor : MonoInvoker.MonoBehaviourEditor {
public override void OnInspectorGUI () {
base.OnInspectorGUI();
//your code.
}
}