Ejemplo n.º 1
0
 public void AnimateAll(LLAnimationStates anim)
 {
     foreach (var runLetter in runLetters)
     {
         runLetter.Stop();
         runLetter.PlayAnimation(anim);
     }
 }
Ejemplo n.º 2
0
 public WalkParameters(Vector3 from, Vector3 to, Vector3 rotation, float duration, float delay = 0f, LLAnimationStates walkAnimation = LLAnimationStates.LL_walking, float walkSpeed = 0f, LLAnimationStates afterWalkAnimation = LLAnimationStates.LL_idle, float afterWalkSpeed = 0f, bool speak = false, bool rotateAfterWalk = false, Vector3 afterWalkRotation = default(Vector3))
 {
     this.from               = from;
     this.to                 = to;
     this.rotation           = rotation;
     this.duration           = duration;
     this.delay              = delay;
     this.walkAnimation      = walkAnimation;
     this.walkSpeed          = walkSpeed;
     this.afterWalkAnimation = afterWalkAnimation;
     this.afterWalkSpeed     = afterWalkSpeed;
     this.speak              = speak;
     this.rotateAfterWalk    = rotateAfterWalk;
     this.afterWalkRotation  = afterWalkRotation;
 }
Ejemplo n.º 3
0
        public void DoSmallJump()
        {
            if ((State != LLAnimationStates.LL_still) &&
                (State != LLAnimationStates.LL_idle))
            {
                if (!hasToGoBackState)
                {
                    backState = State;
                }
                SetState(LLAnimationStates.LL_still);
                hasToGoBackState = true;
            }

            if (inIdleAlternative)
            {
                animator.SetTrigger("stopAlternative");
            }
            animator.SetTrigger("doSmallJump");
        }
Ejemplo n.º 4
0
        public void DoAngry()
        {
            if ((State != LLAnimationStates.LL_still) &&
                (State != LLAnimationStates.LL_idle))
            {
                if (!hasToGoBackState)
                {
                    backState = State;
                }
                SetState(LLAnimationStates.LL_still);
                hasToGoBackState = true;
            }

            if (inIdleAlternative)
            {
                animator.SetTrigger("stopAlternative");
            }
            animator.SetFloat("random", Random.value);
            animator.SetTrigger("doAngry");
        }
Ejemplo n.º 5
0
        public void OnJumpStart()
        {
            if ((State != LLAnimationStates.LL_still) &&
                (State != LLAnimationStates.LL_idle) &&
                (State != LLAnimationStates.LL_walking))
            {
                if (!hasToGoBackState)
                {
                    backState = State;
                }
                SetState(LLAnimationStates.LL_still);
                hasToGoBackState = true;
            }

            if (inIdleAlternative)
            {
                animator.SetTrigger("stopAlternative");
            }
            animator.SetBool("jumping", true);
            animator.SetBool("falling", true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// onLetterShowingBack is called when the letter is twirling and it shows you the back;
        /// so you can swap letter in that moment!
        /// </summary>
        public void DoTwirl(System.Action onLetterShowingBack)
        {
            if ((State != LLAnimationStates.LL_still) &&
                (State != LLAnimationStates.LL_idle) &&
                (State != LLAnimationStates.LL_dancing))
            {
                if (!hasToGoBackState)
                {
                    backState = State;
                }
                SetState(LLAnimationStates.LL_still);
                hasToGoBackState = true;
            }

            if (inIdleAlternative)
            {
                animator.SetTrigger("stopAlternative");
            }

            onTwirlCallback = onLetterShowingBack;
            animator.SetTrigger("doTwirl");
        }
Ejemplo n.º 7
0
        public void DoHorray()
        {
            if ((State != LLAnimationStates.LL_still) &&
                (State != LLAnimationStates.LL_idle) &&
                (State != LLAnimationStates.LL_rocketing))
            {
                if (!hasToGoBackState)
                {
                    backState = State;
                }
                SetState(LLAnimationStates.LL_still);
                hasToGoBackState = true;
            }

            if (!hooraying)
            {
                if (inIdleAlternative)
                {
                    animator.SetTrigger("stopAlternative");
                }
                animator.SetTrigger("doHorray");
            }
        }
Ejemplo n.º 8
0
 public void SetState(LLAnimationStates _newState)
 {
     State = _newState;
 }
Ejemplo n.º 9
0
        void OnStateChanged(LLAnimationStates _oldState, LLAnimationStates _newState)
        {
            //Debug.Log((int)_newState);

            animator.SetBool("walking", false);
            animator.SetBool("dancing", false);
            animator.SetBool("rocketing", false);
            animator.SetBool("dragging", false);
            animator.SetBool("dancing", false);
            animator.SetBool("hanging", false);
            animator.SetBool("tickling", false);
            animator.SetBool("idle", false);

            if (_oldState != LLAnimationStates.LL_limbless && _newState == LLAnimationStates.LL_limbless)
            {
                // going limbless
                if (started)
                {
                    Poof();
                }

                for (int i = 0; i < normalGraphics.Length; ++i)
                {
                    normalGraphics[i].SetActive(false);
                }
                for (int i = 0; i < limblessGraphics.Length; ++i)
                {
                    limblessGraphics[i].SetActive(true);
                }
            }
            else if (_oldState == LLAnimationStates.LL_limbless && _newState != LLAnimationStates.LL_limbless)
            {
                if (started)
                {
                    Poof();
                }

                for (int i = 0; i < normalGraphics.Length; ++i)
                {
                    normalGraphics[i].SetActive(true);
                }
                for (int i = 0; i < limblessGraphics.Length; ++i)
                {
                    limblessGraphics[i].SetActive(false);
                }
            }

            switch (_newState)
            {
            case LLAnimationStates.LL_idle:
            case LLAnimationStates.LL_still:
                animator.SetBool("idle", true);
                break;

            case LLAnimationStates.LL_walking:
                animator.SetBool("walking", true);
                break;

            case LLAnimationStates.LL_rocketing:
                animator.SetBool("rocketing", true);
                break;

            case LLAnimationStates.LL_dancing:
                animator.SetBool("dancing", true);
                break;

            case LLAnimationStates.LL_dragging:
                animator.SetBool("dragging", true);
                break;

            case LLAnimationStates.LL_hanging:
                animator.SetBool("hanging", true);
                break;

            case LLAnimationStates.LL_tickling:
                animator.SetBool("tickling", true);
                break;

            default:
                animator.SetBool("idle", true);
                break;
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// play animation passed by param
 /// </summary>
 /// <param name="_animation"> animation to play </param>
 public void PlayAnimation(LLAnimationStates _animation)
 {
     mLetter.SetState(_animation);
 }
Ejemplo n.º 11
0
        private void Walk(Vector3 from, Vector3 to, Vector3 rotation, float duration, float delay = 0f, LLAnimationStates walkAnimation = LLAnimationStates.LL_walking, float walkSpeed = 0f, LLAnimationStates afterWalkAnimation = LLAnimationStates.LL_idle, float afterWalkSpeed = 0f, bool speak = false, bool rotateAfterWalk = false, Vector3 afterWalkRotation = default(Vector3))
        {
            var parameters = new WalkParameters(from, to, rotation, duration, delay, walkAnimation, walkSpeed, afterWalkAnimation, afterWalkSpeed, speak, rotateAfterWalk, afterWalkRotation);

            StopCoroutine("Walk_Coroutine");
            StartCoroutine("Walk_Coroutine", parameters);
        }
Ejemplo n.º 12
0
 public void PlayAnimation(LLAnimationStates anim)
 {
     letterObject.SetState(anim);
 }