public void kissTheSun()
 {
     //If the player taps the screen they will win the game
     if (!playerHasWon && movie.currentFrameNumber >= 70)
     {
         PlayKissSound();
         movie.gotoAndPlay(153);
         WinGame();
         playerHasWon = true;
     }
 }
 // Use this for initialization
 void Start()
 {
     //Set that the player has not won and start animation at the start
     playerHasWon = false;
     audioPlayer  = GetComponent <AudioSource>();
     movie        = GetComponent <GAFMovieClip>();
     movie.gotoAndPlay(1);
 }
Пример #3
0
 //Down release
 void Stand()
 {
     if (isSitting)
     {
         animator.SetBool("isSitting", false);
         isSitting = false;
         upClip.gotoAndPlay(0);
     }
 }
Пример #4
0
 //Down hold
 void Sit()
 {
     if (!isSitting)
     {
         AudioController.Play("pug_hard_breath");
         isMoving = false;
         EndLeft();
         EndRight();
         MotionTracker.instance.TrackMotion(this, Motion.Sit);
         animator.SetBool("isSitting", true);
         isSitting = true;
         downClip.gotoAndPlay(0);
     }
 }
Пример #5
0
 void SayNo()
 {
     if (!isSayingNo)
     {
         if (Time.timeSinceLevelLoad > NoLastTime)
         {
             AudioController.Play("boy_no");
             isMoving   = false;
             isSayingNo = true;
             NoLastTime = NoLastTime + NoClip.duration();
             animator.SetTrigger("No");
             NoClip.gotoAndPlay(0);
             MotionTracker.instance.TrackMotion(this, Motion.SayNo);
         }
     }
 }
Пример #6
0
 void Pick()
 {
     if (!isPicking)
     {
         if (Time.timeSinceLevelLoad > pickLastTime)
         {
             AudioController.Play("boy_take");
             isMoving  = false;
             isPicking = true;
             MotionTracker.instance.TrackMotion(this, Motion.Stick);
             pickLastTime = pickLastTime + pickClip.duration();
             animator.SetTrigger("Pickup");
             pickClip.gotoAndPlay(0);
         }
     }
 }
Пример #7
0
    void Throw()
    {
        if (!isThrowing)
        {
            if (Time.timeSinceLevelLoad > throwLastTime)
            {
//				AudioController.Play("throw");
                isThrowing = true;
                isMoving   = false;
                MotionTracker.instance.TrackMotion(this, Motion.DropStick);
                throwLastTime = throwLastTime + dropClip.duration();
                animator.SetTrigger("Drop");
                dropClip.gotoAndPlay(0);
            }
        }
    }
Пример #8
0
 void SayYes()
 {
     if (!isSayingYes)
     {
         if (Time.timeSinceLevelLoad > YesLastTime)
         {
             AudioController.Play("boy_yes");
             isMoving    = false;
             isSayingYes = true;
             YesLastTime = YesLastTime + YesClip.duration();
             animator.SetTrigger("Yes");
             YesClip.gotoAndPlay(0);
             MotionTracker.instance.TrackMotion(this, Motion.SayYes);
         }
     }
 }
Пример #9
0
 void Pee()
 {
     if (!isPeeing)
     {
         if (Time.timeSinceLevelLoad > peeT)
         {
             AudioController.Play("pug_piss");
             isPeeing = true;
             isMoving = false;
             EndLeft();
             EndRight();
             MotionTracker.instance.TrackMotion(this, Motion.Pee);
             peeT += peeClip.duration();
             animator.SetTrigger("Pee");
             peeClip.gotoAndPlay(0);
         }
     }
 }
Пример #10
0
 void Pick()
 {
     if (!isPicking)
     {
         if (Time.timeSinceLevelLoad > pickT)
         {
             AudioController.Play("pug_bite");
             isMoving  = false;
             isPicking = true;
             EndLeft();
             EndRight();
             MotionTracker.instance.TrackMotion(this, Motion.Stick);
             pickT += pickClip.duration();
             animator.SetTrigger("PickUp");
             pickClip.gotoAndPlay(0);
         }
     }
 }
Пример #11
0
 void Jump()
 {
     if (!isJumping)
     {
         if (Time.timeSinceLevelLoad > jumpT)
         {
             AudioController.Play("pug_jump2");
             isMoving  = false;
             isJumping = true;
             EndLeft();
             EndRight();
             jumpClip.stop();
             MotionTracker.instance.TrackMotion(this, Motion.Jump);
             jumpT += jumpClip.duration();
             animator.SetTrigger("Jump");
             jumpClip.gotoAndPlay(0);
         }
     }
 }
Пример #12
0
 void Bite()
 {
     if (!isBiting)
     {
         if (Time.timeSinceLevelLoad > biteT)
         {
             AudioController.Play("pug_bite");
             isMoving = false;
             isBiting = true;
             EndLeft();
             EndRight();
             MotionTracker.instance.TrackMotion(this, Motion.Bite);
             biteT += biteClip.duration();
             animator.SetTrigger("Bite");
             biteClip.gotoAndPlay(0);
             if (Mathf.Abs(boy.transform.position.x - transform.position.x) < 20f)
             {
                 Debug.Log("get Pain");
                 boy.GetPain();
             }
         }
     }
 }