public override void OnInspectorGUI()
    {
        UserStudyManager usm = (UserStudyManager)target;


        if (GUILayout.Button("Initialize"))
        {
            usm.Init();
        }

        if (GUILayout.Button("Start Task"))
        {
            usm.StartTask();
        }

        if (GUILayout.Button("End Task"))
        {
            usm.EndTask();
        }

        if (GUILayout.Button("Save Data"))
        {
            usm.SaveData();
        }

        EditorGUILayout.HelpBox("UserStudyManager", MessageType.Info);

        DrawDefaultInspector();
    }
Example #2
0
    void OnGUI()
    {
        GUI.backgroundColor = Color.white;
        GUI.color           = Color.white;

        usm = (UserStudyManager)EditorGUILayout.ObjectField("UserStudyManager", usm, typeof(UserStudyManager), true);

        if (usm == null)
        {
            if (GUILayout.Button("GetManagers"))
            {
                if (UserStudyManager.Instance != null)
                {
                    usm = UserStudyManager.Instance;
                }
            }
        }

        if (usm == null)
        {
            return;
        }

        ConsoleGUI();

        if (!usm.initialized)
        {
            SetupGUI();
        }
        else
        {
            ExperimentGUI();
        }

        EditorGUILayout.HelpBox(usm.log, MessageType.Info);
    }