Tri-Inspector/Editor.Samples/Validators/Validators_RequiredSample.cs
2023-06-24 18:09:23 +04:00

14 lines
362 B
C#

using System.Linq;
using TriInspector;
using UnityEngine;
public class Validators_RequiredSample : ScriptableObject
{
[Required(FixAction = nameof(FixMaterial), FixActionName = "Find in Resources")]
public Material material;
private void FixMaterial()
{
material = Resources.FindObjectsOfTypeAll<Material>().FirstOrDefault();
}
}