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

34 lines
783 B
C#
Raw Normal View History

2024-09-14 06:41:52 +00:00
using Godot;
using System.Reflection;
using System.Collections.Generic;
namespace Rokojori
{
[Tool]
[GlobalClass]
2025-01-03 12:09:23 +00:00
public partial class Vector4PropertyName : ShaderPropertyName
2024-09-14 06:41:52 +00:00
{
2025-08-31 06:05:39 +00:00
public string propertyNameX => propertyName + ".x";
public string propertyNameY => propertyName + ".y";
public string propertyNameZ => propertyName + ".z";
public string propertyNameW => propertyName + ".w";
2024-09-14 06:41:52 +00:00
public void Set( Material material, Vector4 value )
{
2025-01-03 12:09:23 +00:00
_Set( material, value );
2024-09-14 06:41:52 +00:00
}
public Vector4 Get( Material material )
{
2025-01-03 12:09:23 +00:00
return _Get( material, Vector4.Zero );
}
2024-09-14 06:41:52 +00:00
2025-01-03 12:09:23 +00:00
public static Vector4PropertyName Create( string name )
{
var p = new Vector4PropertyName();
p.propertyName = name;
return p;
2024-09-14 06:41:52 +00:00
}
}
2025-01-03 12:09:23 +00:00
2024-09-14 06:41:52 +00:00
}