赞
踩
Hide If Attribute 用于任何属性,并且可以在检查器中隐藏该属性。使用此选项可根据对象的当前状态隐藏不相关的属性。
- [HideIf("IsToggled")]
- public Vector3 HiddenWhenToggled;
-
- [HideIf("SomeObject")]
- public Vector3 ShowWhenNull;
- [HideIf("SomeEnum", InfoMessageType.Info)]
- public Vector3 Info;
- [HideIf("@this.IsToggled && this.SomeObject != null")]
- public int HideWithExpression;
- using Sirenix.OdinInspector;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class HideIfAttributeExample : MonoBehaviour
- {
- public UnityEngine.Object SomeObject;
-
- [EnumToggleButtons]
- public InfoMessageType SomeEnum;
-
- public bool IsToggled;
-
- [HideIf("SomeEnum", InfoMessageType.Info)]
- public Vector3 Info;
-
- [HideIf("IsToggled")]
- public Vector3 HiddenWhenToggled;
-
- [HideIf("SomeObject")]
- public Vector3 ShowWhenNull;
-
- [HideIf("@this.IsToggled && this.SomeObject != null")]
- public int HideWithExpression;
- }
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。