28 lines
795 B
C#
28 lines
795 B
C#
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
|
|
namespace Misaki.ShaderGUI
|
|
{
|
|
public class MaterialPropertyContainer : IMaterialPropertyContainer
|
|
{
|
|
private readonly Dictionary<string, MaterialPropertyInfo> _properties = new();
|
|
|
|
public void AddProperty(MaterialPropertyInfo propertyInfo)
|
|
{
|
|
_properties.Add(propertyInfo.propertyName, propertyInfo);
|
|
}
|
|
|
|
public MaterialProperty GetProperty(string propertyName)
|
|
{
|
|
return _properties[propertyName].Property;
|
|
}
|
|
|
|
public void ReloadProperties(IEnumerable<MaterialProperty> properties)
|
|
{
|
|
foreach (var property in _properties.Values)
|
|
{
|
|
property.ReloadProperty(properties);
|
|
}
|
|
}
|
|
}
|
|
} |