public HeroState(FSM fsm) : base(fsm) { Hero = (HeroMotion)fsm; animator = gameObject.GetComponent<Animator>(); InputManager = gameObject.GetComponent<InputManager>(); }
// Use this for initialization void Start() { mControl = gameObject.AddComponent<HeroControl> () as HeroControl; mControl.mHero = this; mMotion = gameObject.AddComponent<HeroMotion> () as HeroMotion; mMotion.mHero = this; mProperty = gameObject.AddComponent<HeroProperty> () as HeroProperty; mAnimator = gameObject.GetComponent<Animator>() as Animator; }
// Use this for initialization void Start() { mControl = gameObject.AddComponent <HeroControl> () as HeroControl; mControl.mHero = this; mMotion = gameObject.AddComponent <HeroMotion> () as HeroMotion; mMotion.mHero = this; mProperty = gameObject.AddComponent <HeroProperty> () as HeroProperty; mAnimator = gameObject.GetComponent <Animator>() as Animator; }