// Use this for initialization void Start() { anim = GetComponent <Animator> (); if (catMover == null) { catMover = FindObjectOfType <CatMover> (); } }
// Use this for initialization void Start() { catMover = cat.GetComponent <CatMover> (); fpsController = GetComponent <CharacterController> (); foodClip = GetComponent <AudioSource> (); //if (fpsController) { // fpsRigidBody = GetComponent<Rigidbody> (); //} }
void Start() { timer = wanderTimer; cat = transform.parent.gameObject; catRigidBody = transform.parent.GetComponent<Rigidbody> (); jumpClip = GetComponent<AudioSource> (); if ((catMover == null) && (cat != null)) { catMover = cat.GetComponent<CatMover> (); } }
void OnCollisionEnter(Collision col) { if (catMover == null) { catMover = FindObjectOfType <CatMover> (); } if (col.gameObject.CompareTag("floor")) { if (!isCatHit) { CatMover.score++; //catMover.scoreText.text = "SCORE : " + CatMover.score; isCatHit = true; StartCoroutine(waitAndDestroy(10)); } } }