Exemplo n.º 1
0
 void Awake()
 {
     status           = LLStatus.None;
     letterObjectView = livingLetter.GetComponent <LetterObjectView>();
     startingPosition = transform.position;
     startingRotation = letterObjectView.transform.rotation;
 }
Exemplo n.º 2
0
        public void Reset(bool stopCO = true)
        {
            if (stopCO)
            {
                StopAllCoroutines();
            }
            rainbowJet.SetActive(false);

            if (ScannerConfiguration.Instance.gameActive)
            {
                status = LLStatus.None;
                letterObjectView.Falling = false;
                letterObjectView.SetState(LLAnimationStates.LL_still);
                gotSuitcase = false;
                letterObjectView.transform.rotation = startingRotation;
                transform.position = startingPosition;

                fallOffX       = fallOffPoint.position.x;
                midPointX      = midPoint.position.x;
                passedMidPoint = false;

                turnAngle = facingCamera ? 180 : 0;
                gameObject.SetActive(true);

                gameObject.GetComponent <SphereCollider>().enabled = true; // enable feet collider
                bodyCollider.enabled = false;                              // disable body collider
            }
        }
Exemplo n.º 3
0
        IEnumerator co_FlyAway()
        {
//            letterObjectView.DoSmallJump();
            onFlying(this);
            status = LLStatus.Happy;

            letterObjectView.DoSmallJump();
            // Rotate in case not facing the camera
            StartCoroutine(RotateGO(livingLetter, new Vector3(0, 180, 0), 1f));
            yield return(new WaitForSeconds(1f));

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

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

            status = LLStatus.Flying;
            rainbowJet.SetActive(true);
            letterObjectView.SetState(LLAnimationStates.LL_still);
            yield return(new WaitForSeconds(2f));
//            Reset();
        }
Exemplo n.º 4
0
 void Awake()
 {
     status           = LLStatus.None;
     LLController     = livingLetter.GetComponent <LivingLetterController>();
     startingPosition = transform.position;
     startingRotation = LLController.transform.rotation;
 }
Exemplo n.º 5
0
        IEnumerator co_FallOff()
        {
            gotSuitcase = false;
            status      = LLStatus.None;
            onStartFallOff(this);
            LLController.SetState(LLAnimationStates.LL_idle);
            LLController.DoSmallJump();
            StartCoroutine(RotateGO(livingLetter, new Vector3(90, 90, 0), 1f));
            yield return(new WaitForSeconds(0.25f));

            AudioManager.I.PlaySound(Sfx.LetterSad);
            yield return(new WaitForSeconds(0.25f));

            LLController.Falling = true;
            status = LLStatus.Falling;

            yield return(new WaitForSeconds(0.1f));

            LLController.Poof();
            showLLMesh(false);

            yield return(new WaitForSeconds(0.9f));

            onFallOff(this);
        }
Exemplo n.º 6
0
        void OnTriggerEnter(Collider other)
        {
            if (status == LLStatus.Sliding)
            {
                if (other.tag == ScannerGame.TAG_BELT)
                {
//                    transform.parent = other.transform;
                    status = LLStatus.StandingOnBelt;
                    gameObject.GetComponent <SphereCollider>().enabled = false; // disable feet collider
                    bodyCollider.enabled     = true;                            // enable body collider
                    letterObjectView.Falling = false;
                    StartCoroutine(RotateGO(livingLetter, new Vector3(0, turnAngle, 0), 1f));
                    StartCoroutine(AnimateLL());
                }
            }
        }
Exemplo n.º 7
0
        IEnumerator co_FallOff()
        {
            gotSuitcase = false;
            status      = LLStatus.None;
            onStartFallOff(this);
            letterObjectView.SetState(LLAnimationStates.LL_idle);
            letterObjectView.DoSmallJump();
            StartCoroutine(RotateGO(livingLetter, new Vector3(90, 90, 0), 1f));
            yield return(new WaitForSeconds(0.5f));

            letterObjectView.Falling = true;
            status = LLStatus.Falling;

            yield return(new WaitForSeconds(1f));

            onFallOff(this);

//            Reset();
        }
Exemplo n.º 8
0
 IEnumerator co_Lost()
 {
     if (status == LLStatus.StandingOnBelt)
     {
         status = LLStatus.Sad;
         letterObjectView.DoAngry();
         yield return(new WaitForSeconds(1.5f));
     }
     Debug.Log(status);
     if (status != LLStatus.Flying || status != LLStatus.Falling || status != LLStatus.None)
     {
         letterObjectView.Poof();
         yield return(new WaitForSeconds(0.2f));
     }
     else
     {
         yield return(new WaitForSeconds(2f));
     }
     transform.position = new Vector3(-100, -100, -100);           // Move offscreen
 }
Exemplo n.º 9
0
 public void StartSliding()
 {
     letterObjectView.Falling = true;
     status = LLStatus.Sliding;
 }
Exemplo n.º 10
0
 public void StartSliding()
 {
     LLController.Falling = true;
     status = LLStatus.Sliding;
 }