Created
August 14, 2017 07:52
-
-
Save yuw-unknown/3427035f85fe41fe87514a220e67503a to your computer and use it in GitHub Desktop.
Arbor2の他のオブジェクトの状態を監視するSample
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; | |
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