Animator Set Float#
Animation / Animator / Animator Set Float Name, Value, DampTime, DeltaTime
Description#
Executes the Set Float method on the Animator component
Parameters#
| Name | Description |
|---|---|
| Name | |
| Value | |
| Damp Time | |
| Delta Time |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Animator Set Float")]
[Category("Animation/Animator/Set Float", "Name, Value, DampTime, DeltaTime")]
[Description("Executes the Set Float method on the Animator component")]
[Image(typeof(IconAnimator), ColorTheme.Type.Teal)]
[Keywords("Animation, Clip, Play, Animate")]
[Parameter("Name")]
[Parameter("Value")]
[Parameter("Damp Time")]
[Parameter("Delta Time")]
[Serializable]
public class GenInstructionAnimator_SetFloat_4_StringName_FloatValue_FloatDampTime_FloatDeltaTime : Instruction
{
[SerializeField] private GetGameObject m_Animator = new GetGameObject(
new GenTypeGameObject_Animator()
);
[SerializeField] private GetString m_Name = new GetString();
[SerializeField] private GetNumber m_Value = new GetNumber();
[SerializeField] private GetNumber m_DampTime = new GetNumber();
[SerializeField] private GetNumber m_DeltaTime = new GetNumber();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Float");
return $"{this.m_Animator} {method} ({this.m_Name}, {this.m_Value}, {this.m_DampTime}, {this.m_DeltaTime})";
}
protected override Awaitable Run(Args args)
{
Animator component = this.m_Animator.Get<Animator>(args);
if (component == null) return Done;
component.SetFloat(
(string) this.m_Name.Get(args),
(float) this.m_Value.Get(args),
(float) this.m_DampTime.Get(args),
(float) this.m_DeltaTime.Get(args)
);
return Done;
}
}
}