show delegate in Inspector

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.

ok.

no one.

finally, i solved this problem.

DelegateTest.cs
using UnityEngine;
using UnityEngine.Events;

public class DelegateTest : MonoBehaviour
{
	public UnityEvent m_OnPageChanged = new UnityEvent();

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {

	}
}

DelegateTestEditor.cs

using UnityEngine;
using System.Collections;
using UnityEditor;

[CustomEditor(typeof(DelegateTest))]
[CanEditMultipleObjects]
public class DelegateTestEditor : Editor
{
	SerializedProperty m_OnClickProperty;

	void OnEnable()
	{
		m_OnClickProperty = serializedObject.FindProperty("m_OnPageChanged");
	}

	public override void OnInspectorGUI()
	{
		EditorGUILayout.PropertyField(m_OnClickProperty);
		serializedObject.ApplyModifiedProperties();
	}
}

Hello, the approach you’ve find can be done without custom editor.