rj-action-library/Runtime/Shading/Properties/Sampler2DPropertyName.cs

35 lines
812 B
C#
Raw Normal View History

2025-09-21 07:35:17 +00:00
using Godot;
using System.Reflection;
using System.Collections.Generic;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class Sampler2DPropertyName : ShaderPropertyName
{
2025-10-24 11:38:51 +00:00
public override RenderingServer.GlobalShaderParameterType GetParameterType()
{
return RenderingServer.GlobalShaderParameterType.Sampler2D;
}
public static Sampler2DPropertyName albedoTexture = Create( "albedo_texture" );
2025-09-21 07:35:17 +00:00
public void Set( Material material, Texture2D value )
{
_Set( material, value );
}
public Texture2D Get( Material material )
{
return _Get<Texture2D>( material, null );
}
public static Sampler2DPropertyName Create( string name )
{
2025-10-24 11:38:51 +00:00
var t = new Sampler2DPropertyName();
t.propertyName = name;
return t;
2025-09-21 07:35:17 +00:00
}
}
}