rj-action-library/Runtime/Tools/Boxed/FloatValue.cs

50 lines
966 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Text;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class FloatValue:Resource
{
[Export]
public float value;
public override string ToString()
{
return "FloatValue( " + RegexUtility.NumberToString( value ) + " )";
}
public static FloatValue Create( float value )
{
var fv = new FloatValue();
fv.value = value;
return fv;
}
public static FloatValue Clone( FloatValue value, bool deepClone )
{
if ( deepClone )
{
return value == null ? null : Create( value.value );
}
return value;
}
public static void Lerp( FloatValue a, FloatValue b, float amount, FloatValue output )
{
if ( a == null || b == null || output == null )
{
return;
}
output.value = Mathf.Lerp( a.value, b.value, amount );
}
}
}