void Update() { if (bird == null || (bird != null && !bird.IsDead())) { transform.Translate(Vector3.left * speed * Time.deltaTime, Space.World); } }
private void Update() { if (bird.IsDead()) { rigidbody.velocity = Vector2.zero; } }
void OnTriggerExit2D(Collider2D collision) { BirdScript bird = collision.gameObject.GetComponent <BirdScript>(); if (bird && !bird.IsDead()) { bird.AddScore(1); } }
IEnumerator IeSpawn() { while (true) { if (bird.IsDead()) { StopSpawn(); } SpawnPipe(); yield return(new WaitForSeconds(spawnInterval)); } }