29 lines
722 B
C#
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);
|
|
}
|
|
}
|
|
} |