示例#1
0
        IEnumerator co_FlyAway()
        {
            //            letterObjectView.DoSmallJump();
            onFlying(this);
            status = LLStatus.Happy;

            LLController.State = LLAnimationStates.LL_dancing;
            LLController.DoDancingWin();
            //letterObjectView.DoSmallJump();
            // Rotate in case not facing the camera
            StartCoroutine(RotateGO(livingLetter, new Vector3(0, 180, 0), 1f));
            yield return(new WaitForSeconds(2f));

            //			// building anticipation
            //			letterObjectView.Crouching = true;
            //			yield return new WaitForSeconds(1f);
            //			letterObjectView.Crouching = false;

            // Starting flight
            LLController.DoHorray();
            yield return(new WaitForSeconds(0.75f));

            rainbowJet.SetActive(true);
            //yield return new WaitForSeconds(0.15f);
            status = LLStatus.Flying;

            LLController.SetState(LLAnimationStates.LL_still);
            yield return(new WaitForSeconds(2f));
            //            Reset();
        }
        void Update()
        {
            letter.HasFear = fear;
            letter.SetWalkingSpeed(walkSpeed);
            letter.SetDancingSpeed(danceSpeed);

            if (doTransition)
            {
                doTransition = false;
                letter.SetState(targetState);
            }

            if (doHooray)
            {
                doHooray = false;
                letter.DoHorray();
            }


            if (doAngry)
            {
                doAngry = false;
                letter.DoAngry();
            }


            if (doHighFive)
            {
                doHighFive = false;
                letter.DoHighFive();
            }


            if (onJumpStart)
            {
                onJumpStart = false;
                letter.OnJumpStart();
            }


            if (onJumpMiddle)
            {
                onJumpMiddle = false;
                letter.OnJumpMaximumHeightReached();
            }



            if (onJumpEnd)
            {
                onJumpEnd = false;
                letter.OnJumpEnded();
            }

            if (doSmallJump)
            {
                doSmallJump = false;
                letter.DoSmallJump();
            }

            if (doDanceWin)
            {
                doDanceWin = false;
                letter.DoDancingWin();
            }

            if (doDanceLose)
            {
                doDanceLose = false;
                letter.DoDancingLose();
            }

            if (doTwirl)
            {
                doTwirl = false;
                letter.DoTwirl(() => { Debug.Log("BACK!"); });
            }

            if (doToggleDance)
            {
                doToggleDance = false;
                letter.ToggleDance();
            }
        }