Beispiel #1
0
    public override void OnInspectorGUI()
    {
        this.serializedObject.Update();
        Object[] targetObjs = this.serializedObject.targetObjects;

        IgnoreTagModifier curEditTarget;

        GUIContent content;

        EditorGUIUtility.labelWidth = PGEditorUtils.CONTROLS_DEFAULT_LABEL_WIDTH;

        EditorGUI.indentLevel = 1;

        GUILayout.Space(6);


        if (this.serializedObject.isEditingMultipleObjects)
        {
            content = new GUIContent("Tags to Ignore", "List of tags to ignore.");
            EditorGUILayout.PropertyField(this.ignoreList, content, true);
        }
        else
        {
            curEditTarget = (IgnoreTagModifier)targetObjs[0];

            // Display and get user changes
            PGEditorUtils.FoldOutTextList
            (
                "Tags to ignore",
                curEditTarget.ignoreList,
                true                  // Force the fold-out state
            );
        }

        GUILayout.Space(4);

        content = new GUIContent
                  (
            "Debug Level", "Set it higher to see more verbose information."
                  );
        EditorGUILayout.PropertyField(this.debugLevel, content);

        serializedObject.ApplyModifiedProperties();

        // Flag Unity to save the changes to to the prefab to disk
        //   This is needed to make the gizmos update immediatly.
        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }