19 lines
485 B
C#
19 lines
485 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Beyond
|
|
{
|
|
public class vAnimatorCycleOffset : StateMachineBehaviour
|
|
{
|
|
public string parameterName;
|
|
public float minOffset;
|
|
public float maxOffset;
|
|
|
|
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
animator.SetFloat(parameterName, Random.Range(minOffset, maxOffset));
|
|
}
|
|
}
|
|
}
|