inspector扩展之 GM工具

1.inspector GM工具

使用方法:

将Inspector_GMOrder 放到编辑器目录下。

将GM_Order 挂载到游戏对象上

public class GM_Order : MonoBehaviour {

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

[CustomEditor(typeof(GM_Order))]
public class Inspector_GMOrder : Editor
{
    string gm_value = "";
    public override void OnInspectorGUI()
    {
        gm_value = GUILayout.TextField(gm_value);
        if (GUILayout.Button("获得指定车辆"))
        {
            for (int i = 1; i < 15; i++)
            {
                PassionSpeedMgrData.inst.SavePrefs(i);
            }
            //Hero.Inst.HeroReLive();
            

        }
        if (GUILayout.Button("暂定"))
        {
            //UserInfo.GetInst().myDiamond = 99;
        }
    }
}
发布了54 篇原创文章 · 获赞 37 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/osuckseed/article/details/89206856