Files
com.misaki.shader-gui/Editor/Models/MaterialPropertyInfo.cs
2025-02-01 23:08:14 +09:00

29 lines
722 B
C#

using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Misaki.ShaderGUI
{
public class MaterialPropertyInfo
{
private MaterialProperty _property;
public readonly string propertyName;
public readonly GUIContent label;
public MaterialProperty Property => _property;
public MaterialPropertyInfo(string propName, GUIContent content)
{
propertyName = propName;
label = content;
_property = null;
}
public void ReloadProperty(IEnumerable<MaterialProperty> properties)
{
_property = properties.First(p => p.name == propertyName);
}
}
}