Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
    override public void BuildState()
    {
        m_characterAnimations = CharacterFactory.Instance.buildHeroAnimation();

        Add(m_characterAnimations);
        base.BuildState();
    }
Ejemplo n.º 3
0
 public void SetCharacterAnimation(AFStatesController value)
 {
     _characterAnimations = value;
 }
Ejemplo n.º 4
0
 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);
 }