美文网首页
Odin Inspector 系列教程 --- Hide Dup

Odin Inspector 系列教程 --- Hide Dup

作者: su9257_海澜 | 来源:发表于2019-10-09 09:58 被阅读0次

HideDuplicateReferenceBox

using Sirenix.OdinInspector;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HideDuplicateReferenceBoxAttributeExample : MonoBehaviour
{
    [ShowInInspector]
    public ReferenceTypeClass firstObject;
    [ShowInInspector]
    public ReferenceTypeClass withReferenceBox;
    [ShowInInspector]
    [HideDuplicateReferenceBox]
    public ReferenceTypeClass withoutReferenceBox;
    

    [Button("初始化",ButtonSizes.Large)]
    public void Setup()
    {
        this.firstObject = new ReferenceTypeClass();
        this.withReferenceBox = this.firstObject;
        this.withoutReferenceBox = this.firstObject;
        this.firstObject.recursiveReference = this.firstObject;
    }

    public partial class ReferenceTypeClass
    {
        [HideDuplicateReferenceBox]
        public ReferenceTypeClass recursiveReference;
    }
}


更多教程内容详见:革命性Unity 编辑器扩展工具 --- Odin Inspector 系列教程

相关文章

网友评论

      本文标题:Odin Inspector 系列教程 --- Hide Dup

      本文链接:https://www.haomeiwen.com/subject/oodbpctx.html