Exemple #1
0
    //
    private void KeyValuePairListGUI <T> (string label, SaveData.KeyValuePairLists <T> keyValuePairList, Action <T> specificGUI)
    {
        // Create Box for all DataTypes
        EditorGUILayout.BeginVertical(GUI.skin.box);
        // Indent each Box
        EditorGUI.indentLevel++;
        // Dispaly Label for DataType
        EditorGUILayout.LabelField(label);

        // If DataTypes where Found
        if (keyValuePairList.keys.Count > 0)
        {
            // Go through all Found DataTypes
            for (int i = 0; i < keyValuePairList.keys.Count; i++)
            {
                // Create box for DataType
                EditorGUILayout.BeginHorizontal();

                // Display Label and Properties
                EditorGUILayout.LabelField(keyValuePairList.keys[i]);
                specificGUI(keyValuePairList.values[i]);

                // End box for DataType
                EditorGUILayout.EndHorizontal();
            }
        }

        // Stop Indent level
        EditorGUI.indentLevel--;
        // End VerticalBox for all DataTypes
        EditorGUILayout.EndVertical();
    }
Exemple #2
0
    private void KeyValuePairListsGUI <T> (string label, SaveData.KeyValuePairLists <T> keyvaluePairList, Action <T> specificGUI)
    {
        // Surround each data type in a box.
        EditorGUILayout.BeginVertical(GUI.skin.box);
        EditorGUI.indentLevel++;

        // Display a label for this data type.
        EditorGUILayout.LabelField(label);

        // If there are data elements...
        if (keyvaluePairList.keys.Count > 0)
        {
            // ... go through each of them...
            for (int i = 0; i < keyvaluePairList.keys.Count; i++)
            {
                EditorGUILayout.BeginHorizontal();

                // ... and display a label for each followed by GUI specific to their type.
                EditorGUILayout.LabelField(keyvaluePairList.keys[i]);
                specificGUI(keyvaluePairList.values[i]);

                EditorGUILayout.EndHorizontal();
            }
        }

        EditorGUI.indentLevel--;
        EditorGUILayout.EndVertical();
    }
    private void KeyValuePairListsGUI <T> (string label, SaveData.KeyValuePairLists <T> keyvaluePairList, Action <T> specificGUI)
    {
        EditorGUILayout.BeginVertical(GUI.skin.box);
        EditorGUI.indentLevel++;

        EditorGUILayout.LabelField(label);

        if (keyvaluePairList.keys.Count > 0)
        {
            for (int i = 0; i < keyvaluePairList.keys.Count; i++)
            {
                EditorGUILayout.BeginHorizontal();

                EditorGUILayout.LabelField(keyvaluePairList.keys[i]);
                specificGUI(keyvaluePairList.values[i]);

                EditorGUILayout.EndHorizontal();
            }
        }

        EditorGUI.indentLevel--;
        EditorGUILayout.EndVertical();
    }