Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        ZoomNumber g = target as ZoomNumber;

        if (g.gameObject.activeSelf == false)
        {
            return;
        }

        int newV = EditorGUILayout.IntField("值", g.GetValue());

        if (newV != g.GetValue())
        {
            g.SetValue(newV);
        }

        if (GUILayout.Button("增加1", GUILayout.Height(50)))
        {
            g.Add();
        }
    }