Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Arbor2の他のオブジェクトの状態を監視するSample
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Arbor
{
/**
* 猫が茂みに居るStatusになった際に、次のStateを呼び出します
*/
[AddComponentMenu("")]
[AddBehaviourMenu("ぱたぱたう〜のん/Transition/猫が茂みにいる時にTransition")]
[BuiltInBehaviour]
public class ArborCatStateStageIn : StateBehaviour {
[SerializeField] private Cat _Cat; // 猫Object, GameObjectまで不要なのでComponentを取得
[SerializeField] private StateLink _NextState; // 次のState
void Start() {}
void Update() {
if (_Cat.CurrentState == Cat.CatState.Stay_StageIn) {
Transition(_NextState);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.