RotationDrag.cs
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using UnityEngine.EventSystems;
using System.Collections.Generic;
public delegate void OnPageChanged(int curPage);
public class RotationDrag : MonoBehaviour
{
public GameObject m_Template;
public OnPageChanged m_OnPageChanged;
}
RotationDragEditor.cs
using UnityEditor;
using UnityEngine;
using System.Collections;
[CustomEditor(typeof(RotationDrag))]
[CanEditMultipleObjects]
public class RotationDragEditor : Editor {
public override void OnInspectorGUI()
{
RotationDrag tScript = (RotationDrag)target;
tScript.m_Template = EditorGUILayout.ObjectField("Template", tScript.m_Template, tScript.m_Template.GetType(), true) as GameObject;
//here how to show m_OnPageChanged like the button's Onclick of ugui
}
}
this is my code.
RotationDrag.cs has much member. It’s have lots work way by different member value.
so i write a RotationDragEditor.cs to control the member’s name in Inspector to show how this value work.
Now, i’d like a typesetting like the button’s OnClick event of ugui.
How can i do?
thx.