public void Initialize() { _characterAnimations = AFObject.Create <AFStatesController>(); string path = PathConstants.GetGameScenePath() + "cucaSprites"; AMovieClip animation = AnimationFactory.Instance.BuildAnimation(path, STATE_HITED); _characterAnimations.Add(STATE_HITED, animation, false); animation = AnimationFactory.Instance.BuildAnimation(path, STATE_ANGRY); _characterAnimations.Add(STATE_ANGRY, animation, false); animation = AnimationFactory.Instance.BuildAnimation(path, STATE_IDLE); _characterAnimations.Add(STATE_IDLE, animation, true); _characterAnimations.gameObject.transform.parent = this.gameObject.transform; _sprite = _characterAnimations.GetCurrentState().GetSprite(); this.gameObject.AddComponent <BoxColliderResizer>().Initialize(); if (this.gameObject.GetComponent <AnimationController>()) { this.gameObject.GetComponent <AnimationController>().Initialize(); } }
override public void BuildState() { m_characterAnimations = CharacterFactory.Instance.buildHeroAnimation(); Add(m_characterAnimations); base.BuildState(); }
public void SetCharacterAnimation(AFStatesController value) { _characterAnimations = value; }
public void Initialize() { _animationController = this.gameObject.GetComponent <Character>().GetCharacterAnimation(); _hitedState = _animationController.GetState(Character.STATE_HITED); this.gameObject.GetComponent <Character>().GetCharacterAnimation().GetState(Character.STATE_HITED).OnComplete.Add(CompleteHitedAnimation); }