using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(S_Socket))] //需要显示在Inspector的脚本
public class S_EditorTest : Editor //继承Editor类
{
S_Socket s_Socket;
public override void OnInspectorGUI()
{
s_Socket = (S_Socket)target; // 获取当前脚本数据
GUILayout.Button("Button"+s_Socket.str);
}
}
效果: