mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
20 lines
478 B
C#
20 lines
478 B
C#
using UnityEngine;
|
|
|
|
public class StateCullingMode : StateMachineBehaviour
|
|
{
|
|
public AnimatorCullingMode cullingMode;
|
|
|
|
private AnimatorCullingMode lastMode;
|
|
|
|
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
lastMode = animator.cullingMode;
|
|
animator.cullingMode = cullingMode;
|
|
}
|
|
|
|
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
animator.cullingMode = lastMode;
|
|
}
|
|
}
|