28 lines
730 B
C#
28 lines
730 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text.RegularExpressions;
|
|
using System.Text;
|
|
using Godot;
|
|
|
|
namespace Rokojori
|
|
{
|
|
[Tool]
|
|
[GlobalClass]
|
|
public abstract partial class FloatDriverTarget:Resource
|
|
{
|
|
|
|
[Export]
|
|
public Curve mappingCurve;
|
|
|
|
public abstract string GetTargetMemberPath( IFloatDriver driver );
|
|
|
|
public abstract GodotObject GetGodotObject( IFloatDriver driver );
|
|
|
|
public void Update( IFloatDriver driver )
|
|
{
|
|
var mappedValue = mappingCurve.Sample( driver.GetDriverFloatValue() );
|
|
var targetMemberPath = GetTargetMemberPath( driver );
|
|
TweenFloat.SetTargetValue( GetGodotObject( driver ), targetMemberPath, mappedValue );
|
|
}
|
|
}
|
|
} |