Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to add some extra functions to editor inspector for UI.Button but, I can't setup my script in this way :-/ How can I write custom inspector for UI Objects ? This is what I wrote:

using UnityEngine;
using System.Collections;

[CustomEditor(typeof(UnityEngine.UI.Button))]
[CanEditMultipleObjects]
public class AlignmentEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EditorGUILayout.HelpBox("Test", MessageType.Info);
    }
}
share|improve this question
    
What is it displaying at the moment with your listed code? –  Savlon Jul 30 at 3:55
    
@Savlon nothing :-/ –  piotrek Jul 30 at 5:24
    
Isn't there a compile error since you didn't import UnityEditor namespace? –  nexx Jul 30 at 14:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.