rj-action-library/Runtime/Animation/Highlight/Highlighter.cs

65 lines
1.2 KiB
C#
Raw Normal View History

2025-01-18 12:49:14 +00:00
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;
using Godot;
namespace Rokojori
{
public enum HighlightActionType
{
Start,
End
}
public class HighlightTargets
{
public Node3D[] targets;
public int activeAnimationTarget = -1;
public List<Material> originalMaterial;
public List<Material> animationMaterial;
}
[Tool]
[GlobalClass]
public partial class Highlighter:Node
{
[Export]
public HighlightFlag flag;
[Export]
public Material material;
List<HighlightTargets> _activeTargets = new List<HighlightTargets>();
public void Highlight( HighlightActionType type, Node3D[] targets )
{
if ( HighlightActionType.End == type )
{
var t = _activeTargets.Find( a => a.targets == targets );
if ( t == null )
{
return;
}
// Get materials
// Animate
// Swap Original Material;
// Remove Materials;
}
else if ( HighlightActionType.Start == type )
{
// Create target
// Create materials
// Swap animation materials
// Animate
}
}
}
}