Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Display out-of-sync properties (w.r.t. prefabs) in bold #33

Closed
jacobdufault opened this issue Mar 17, 2014 · 2 comments
Closed

Display out-of-sync properties (w.r.t. prefabs) in bold #33

jacobdufault opened this issue Mar 17, 2014 · 2 comments

Comments

@jacobdufault
Copy link
Owner

No description provided.

@jacobdufault
Copy link
Owner Author

This will require some reflection into Unity internals -- hopefully future updates won't break it!

    /// <summary>
    /// Attempts to enable/disable the bold font that is used by Unity when an object has a
    /// value different from its prefab.
    /// </summary>
    /// <param name="enabled">True if the bold font is set, false if it is not.</param>
    public static void SetBoldDefaultFont(bool enabled) {
        var method = typeof(EditorGUIUtility).GetMethod("SetBoldDefaultFont",
            BindingFlags.Static | BindingFlags.NonPublic);

        if (method == null) {
            return;
        }
        method.Invoke(null, new object[] { enabled });
    }

@jacobdufault
Copy link
Owner Author

I have a working solution, but only for top-level fields on the BaseBehavior; that is, nested fields inside of the BaseBehavior cannot be individually tailored; it's an all or nothing type of thing. I'm going to close this issue and open another one for nested properties.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant