コード例 #1
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);
         }
     }
 }
コード例 #2
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);
            }
        }
    }
コード例 #3
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);
         }
     }
 }
コード例 #4
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);
         }
     }
 }
コード例 #5
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);
         }
     }
 }
コード例 #6
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);
         }
     }
 }
コード例 #7
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);
         }
     }
 }
コード例 #8
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();
             }
         }
     }
 }