示例#1
0
    override public void OnInspectorGUI()
    {
        DrawDefaultInspector();

        IdleMoneyManager myScript = (IdleMoneyManager)target;

        // Debugging title and toggle
        GUILayout.Label("Debugging", EditorStyles.boldLabel);
        debugging = EditorGUILayout.Toggle("Show Debug Menu", debugging);

        if (debugging)
        {
            // Give money layout
            GUILayout.BeginHorizontal();
            giveMoney = EditorGUILayout.DoubleField("Give Money", giveMoney);
            if (GUILayout.Button("Go"))
            {
                myScript.AddMoney(giveMoney);
            }
            GUILayout.EndHorizontal();

            // Reduce money layout
            GUILayout.BeginHorizontal();
            reduceMoney = EditorGUILayout.DoubleField("Take Money", reduceMoney);
            if (GUILayout.Button("Go"))
            {
                myScript.ReduceMoney(reduceMoney);
            }
            GUILayout.EndHorizontal();
        }
    }
示例#2
0
 void Awake()
 {
     Instance = this;
 }