29 lines
530 B
C#
29 lines
530 B
C#
using Godot;
|
|
using System.Reflection;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Rokojori
|
|
{
|
|
public class CustomMaterialProperty<[MustBeVariant] T>
|
|
{
|
|
public CustomMaterialProperty( CustomMaterial m, ShaderPropertyName n )
|
|
{
|
|
_material = m;
|
|
_name = n;
|
|
}
|
|
|
|
CustomMaterial _material;
|
|
ShaderPropertyName _name;
|
|
|
|
public T Get()
|
|
{
|
|
return _name._Get<T>( _material, default( T ) );
|
|
}
|
|
|
|
public void Set( T value )
|
|
{
|
|
_name._Set<T>( _material, value );
|
|
}
|
|
|
|
}
|
|
} |