Initial upload
This commit is contained in:
28
Editor/MaterialPropertyContainer.cs
Normal file
28
Editor/MaterialPropertyContainer.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user