示例#1
0
 void OnCollisionEnter(Collision co)
 {
     collisionCount++;
     if (collisionCount > 1 && !CatPreferences.IsStarving())
     {
         catControl.MoveTo(transform.position);
         CatPreferences.addBallPlayingNum();
         collisionCount = 0;
     }
     yPosition = co.transform.position.y;
 }
示例#2
0
 public void OnDrag(PointerEventData eventData)
 {
     strokingNum++;
     if (strokingNum > strokingThreshold)
     {
         GetComponent <Animation> ().Play("IdleSit");
         GetComponent <Animation> ().PlayQueued("Idle");
         strokingNum = 0;
         CatPreferences.addStrokingNum();
     }
 }
示例#3
0
 bool checkTemper()
 {
     if (((int)CatPreferences.ElapsedSecondsFromLastCared) % 20 == 0)
     {
         GetComponent <Animation> ().Play("Ithcing");
         GetComponent <Animation> ().PlayQueued("Idle");
         return(false);
     }
     if (CatPreferences.IsGoodTemper() && !isMoving)
     {
         Vector3 cameraPos = Camera.main.transform.position;
         cameraPos.y = rb.transform.position.y;
         float dist = (cameraPos - rb.transform.position).magnitude;
         if (dist > 1.0f)
         {
             MoveTo(Camera.main.transform.position, -0.5f);
         }
         return(false);
     }
     return(true);
 }
示例#4
0
 void OnTriggerEnter(Collider co)
 {
     Invoke("Hide", 2.0f);
     CatPreferences.SaveLastFeedTime();
 }