void OnCollisionEnter(Collision co) { collisionCount++; if (collisionCount > 1 && !CatPreferences.IsStarving()) { catControl.MoveTo(transform.position); CatPreferences.addBallPlayingNum(); collisionCount = 0; } yPosition = co.transform.position.y; }
public void OnDrag(PointerEventData eventData) { strokingNum++; if (strokingNum > strokingThreshold) { GetComponent <Animation> ().Play("IdleSit"); GetComponent <Animation> ().PlayQueued("Idle"); strokingNum = 0; CatPreferences.addStrokingNum(); } }
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); }
void OnTriggerEnter(Collider co) { Invoke("Hide", 2.0f); CatPreferences.SaveLastFeedTime(); }