Пример #1
0
    override public void OnInspectorGUI()
    {
        LoadLevel loadLevel = target as LoadLevel;

        GUIStyle myFoldoutStyle = new GUIStyle(EditorStyles.foldout);

        myFoldoutStyle.fontStyle = FontStyle.Bold;
        myFoldoutStyle.fontSize  = 14;
        Color myStyleColor = Color.red;

        myFoldoutStyle.normal.textColor    = myStyleColor;
        myFoldoutStyle.onNormal.textColor  = myStyleColor;
        myFoldoutStyle.hover.textColor     = myStyleColor;
        myFoldoutStyle.onHover.textColor   = myStyleColor;
        myFoldoutStyle.focused.textColor   = myStyleColor;
        myFoldoutStyle.onFocused.textColor = myStyleColor;
        myFoldoutStyle.active.textColor    = myStyleColor;
        myFoldoutStyle.onActive.textColor  = myStyleColor;

        GUIStyle myFoldoutStyle2 = new GUIStyle(EditorStyles.foldout);

        myFoldoutStyle2.fontStyle = FontStyle.Bold;
        myFoldoutStyle2.fontSize  = 14;
        Color myStyleColor2 = Color.blue;

        myFoldoutStyle2.normal.textColor    = myStyleColor2;
        myFoldoutStyle2.onNormal.textColor  = myStyleColor2;
        myFoldoutStyle2.hover.textColor     = myStyleColor2;
        myFoldoutStyle2.onHover.textColor   = myStyleColor2;
        myFoldoutStyle2.focused.textColor   = myStyleColor2;
        myFoldoutStyle2.onFocused.textColor = myStyleColor2;
        myFoldoutStyle2.active.textColor    = myStyleColor2;
        myFoldoutStyle2.onActive.textColor  = myStyleColor2;

        showManager = EditorGUILayout.Foldout(showManager, "Level Manager", myFoldoutStyle);
        //myScript.l = EditorGUILayout.PropertyField (myScript.l);

        loadLevel.level = EditorGUILayout.IntField("aktueller Index:", loadLevel.level);
        if (showManager)
        {
            serializedObject.Update();
            list.DoLayoutList();
            serializedObject.ApplyModifiedProperties();
        }

        showEinstellung = EditorGUILayout.Foldout(showEinstellung, "Einstellungen", myFoldoutStyle2);
        if (showEinstellung)
        {
            loadLevel.downloadBackendLink   = EditorGUILayout.TextField("DOWNLOADBACKENDLINK", loadLevel.downloadBackendLink);
            loadLevel.uploadBackendLink     = EditorGUILayout.TextField("UPLOADBACKENDLINK", loadLevel.uploadBackendLink);
            loadLevel.uploadMeasurementLink = EditorGUILayout.TextField("UPLOADMEASUREMENTLINK", loadLevel.uploadMeasurementLink);
            loadLevel.deleteBackendLink     = EditorGUILayout.TextField("DELETEBACKENDDATABASE", loadLevel.deleteBackendLink);
            loadLevel.uploadFilesLink       = EditorGUILayout.TextField("UPLOADFILESLINK", loadLevel.uploadFilesLink);
            LoadLevel myScript = (LoadLevel)target;

            if (GUILayout.Button("upload Backend to DataBase"))
            {
                if (EditorUtility.DisplayDialog("Warning! Das hier löscht die ausgewählte Upload-Datenbank! Sicher, dass du fortfahren willst?", "", "Ja", "Nein"))
                {
                    myScript.uploadDatabase();
                }
            }

            if (GUILayout.Button("upload Measurement to DataBase"))
            {
                myScript.uploadMeasurementDatabase();
            }

            loadLevel.version = EditorGUILayout.TextField("Version:", loadLevel.version);
            //EditorGUILayout.PropertyField(serializedObject.FindProperty("tan"), true);
            //EditorGUILayout.PropertyField(serializedObject.FindProperty("benutzerPW"), true);

            if (GUILayout.Button("generate TAN"))
            {
                myScript.generateTAN();
            }

            serializedObject.Update();
            benutzerPW.DoLayoutList();
            serializedObject.ApplyModifiedProperties();

            loadLevel.einstellungPW = EditorGUILayout.TextField("EinstellungPW:", loadLevel.einstellungPW);
            serializedObject.ApplyModifiedProperties();
            //myScript.tan = EditorGUILayout.PropertyField (myScript.tan,true);
            //DrawDefaultInspector();
        }
    }