Set Animator Keep Animator State On Disable#
Animation / Animator / Set Animator Keep Animator State On Disable
Description#
Sets the Keep Animator State On Disable property of Animator component
Parameters#
| Name | Description |
|---|---|
| Animator | |
| Value |
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("Set Animator Keep Animator State On Disable")]
[Category("Animation/Animator/Keep Animator State On Disable")]
[Description("Sets the Keep Animator State On Disable property of Animator component")]
[Image(typeof(IconAnimator), ColorTheme.Type.Teal)]
[Keywords("Animation, Clip, Play, Animate")]
[Parameter("Animator")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_Animator_SetKeepAnimatorStateOnDisable : Instruction
{
[SerializeField] private GetGameObject m_Animator = new GetGameObject(
new GenTypeGameObject_Animator()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Keep Animator State On Disable");
return $"{this.m_Animator} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
Animator component = this.m_Animator.Get<Animator>(args);
if (component == null) return Done;
component.keepAnimatorStateOnDisable = (bool) this.m_Value.Get(args);
return Done;
}
}
}