DarkRewar / BaseTool

A big library of basic tools that you might need in your Unity projects.
MIT License
41 stars 6 forks source link

Fix `IfAttribute` using property #78

Closed DarkRewar closed 5 months ago

DarkRewar commented 5 months ago
using BaseTool;
using UnityEngine;

public class Test : MonoBehaviour
{
  public enum MyEnum 
  {
    TwoD,
    ThreeD
  }

  [SerializeField] private MyEnum _dimension = MyEnum.ThreeD;
  public bool Is2D => _dimension == MyEnum.TwoD;

  [If(nameof(Is2D))]
  public GameObject Prefab2D;
}