rj-action-library/Runtime/Rendering/TextureAttributes/SetTextureAttributeChannel.cs

46 lines
938 B
C#
Raw Normal View History

2025-10-24 11:38:51 +00:00
using Godot;
using Rokojori;
using System.Collections.Generic;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class SetTextureAttributeChannel:Action
{
[Export]
public TextureAttributes textureAttributes;
[Export]
public int index = 0;
[Export]
public float value = 1;
[Export]
public TextureAttributes.Channel channel = TextureAttributes.Channel.Red;
2025-10-26 20:23:51 +00:00
[Export]
public TextureAttributes.OperatorType operatorType = TextureAttributes.OperatorType.Set;
2025-10-24 11:38:51 +00:00
protected override void _OnTrigger()
{
var ta = textureAttributes;
if ( ta == null )
{
ta = Unique<TextureAttributes>.Get();
}
if ( ta == null )
{
this.LogInfo( "No attributes found..." );
return;
}
this.LogInfo( "Index", index, "Value:", value, "Channel:", channel );
2025-10-26 20:23:51 +00:00
ta.SetChannel( index, value, channel, operatorType );
2025-10-24 11:38:51 +00:00
}
}
}