using Godot; using System.Reflection; using System.Collections.Generic; namespace Rokojori { [Tool] [GlobalClass] public partial class UVChannel:ShaderGenerationModule { [Export] public string uvTarget = "UV"; [Export] public UVSource uvSource = new MeshUVSource(); [Export] public UVModifier modifier = new UVScaleOffset(); public List GetShaderCode( ShaderGenerationContext context ) { var sourceCode = uvSource.GetUV( context, uvTarget, 0 ); var modifierCode = modifier.ModifyUV( context, uvTarget ); if ( sourceCode == null && modifierCode == null ) { return null; } var list = new List(); if ( sourceCode != null ) { list.AddRange( sourceCode ); } if ( modifierCode != null ) { list.AddRange( modifierCode ); } return list; } } }