top of page
  • 作家相片fang ma

Inspector GUI

public variables shown in the Inspector when inheriting


Class used on game object

using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 using System;
 
 [Serializable]
public class UIButton : Button
{
    public enum TestEnum { ON, OFF }
 
    public int testInt;
    public TestEnum testEnumVar;
}

Class used to override the inspectorGUI

 using UnityEngine;
 using System.Collections;
 using UnityEditor;
 [CustomEditor(typeof(UIButton))]
public class UIButtonEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        UIButton t = (UIButton)target;
    }
}

14 次查看0 則留言

相關文章

查看全部

[VIVE]SRanipal_AvatarLipSample Modified Script

Unity_HeadboxVive_0308 //========= Copyright 2019, HTC Corporation. All rights reserved. ===========using System.Collections.Generic; using UnityEngine; namespace ViveSR { namespace anipal { nam

Commentaires


bottom of page