35 lines
868 B
C#
35 lines
868 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Beyond
|
|
{
|
|
public class vSetAnimatorBool : StateMachineBehaviour
|
|
{
|
|
public string boolName;
|
|
|
|
[Header("OnEnter")]
|
|
public bool useOnEnter;
|
|
public bool setToOnEnter;
|
|
[Header("OnExit")]
|
|
public bool useOnExit;
|
|
public bool setToOnExit;
|
|
|
|
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
if (useOnEnter)
|
|
{
|
|
animator.SetBool(boolName, setToOnEnter);
|
|
}
|
|
}
|
|
|
|
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
if (useOnExit)
|
|
{
|
|
animator.SetBool(boolName, setToOnExit);
|
|
}
|
|
}
|
|
}
|
|
}
|