Make Tile System Component Multi-Object Editable in Inspector

BenBearfish
New Member
Registered: 2014-03-19
Posts: 5

Topic

It'd be nice if we could have the Tile System component be multi-object editable within the inspector so it's easier to set optimization settings for lots of Tile Systems in the scene.

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 1

This feature has been implemented and will be available in the next release 2.3.0. The next release is still a little way off, just wanted to let you know that your feature request has been fulfilled :)

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 2

Multi-object editing support has also been added to the custom brush property drawer which is used when exposing brushes from custom scripts:

using UnityEngine;
using Rotorz.Tile;

public class ExampleBehaviour : MonoBehaviour {
    // The following field can now express a mixed value when editing
    // multiple instances of this 'ExampleBehaviour' class.
    public Brush someBrush;
}

Brush field with mixed values

As you would expect, this is also available when using EditorGUI.PropertyField:

using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(ExampleBehaviour))]
public class ExampleBehaviourEditor : Editor {
    private SerializedProperty someBrushProp;

    private void OnEnable() {
        someBrushProp = serializedObject.FindProperty("someBrush");
    }

    public override void OnInspectorGUI() {
        serializedObject.Update();

        EditorGUILayout.PropertyField(someBrushProp, new GUIContent("Some Brush"));

        serializedObject.ApplyModifiedProperties();
    }
}

The various RotorzEditorGUI.BrushField overloads now respect the status of EditorGUI.showMixedValue for consistency with the GUI controls provided by Unity itself. This is useful for those who are implementing custom editor interfaces with brush fields.