Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
ランダムに値を変えるStateMachineBehaviour
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomBehaviour : StateMachineBehaviour
{
int hashRandom = Animator.StringToHash("random");
override public void OnStateMachineEnter(Animator animator, int stateMachinePathHash)
{
animator.SetInteger(hashRandom, Random.Range (0, 4));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment