Created
November 8, 2017 12:40
-
-
Save tsubaki/d59af36d887d216b4bf1151470ed0694 to your computer and use it in GitHub Desktop.
ランダムに値を変えるStateMachineBehaviour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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