void Update() { if (Input.GetKey(KeyCode.Space) || Input.GetMouseButtonDown(0)) { Destroy(gameObject); GameObject bird = GameObject.Find("Blue_Bird3"); birdMove targetScript = bird.GetComponent <birdMove>(); targetScript.start = true; } }
// Update is called once per frame void Update() { GameObject bird = GameObject.Find("Blue_Bird3"); birdMove targetScript = bird.GetComponent <birdMove>(); start1 = targetScript.start; if (start1) { Vector3 coord = transform.position; coord.z = 0; transform.position = coord; } }
// Update is called once per frame void Update() { if (!dead1) { Vector3 pos = transform.position; pos.x -= 0.1f; transform.position = pos; if (transform.position.x <= -13) { Vector3 pos1 = transform.position; pos1.x = 13; transform.position = pos1; } GameObject bird = GameObject.Find("Blue_Bird3"); birdMove targetScript = bird.GetComponent <birdMove>(); dead1 = targetScript.dead; } }
// Update is called once per frame void Update() { //t.text = "Score" + score; GetComponent <TextMesh>().text = "Score : " + score; GameObject bird = GameObject.Find("Blue_Bird3"); birdMove targetScript = bird.GetComponent <birdMove>(); dead1 = targetScript.dead; if (dead1) { GetComponent <TextMesh>().text = " RIP \n" + " Score : " + score; Vector3 pos = transform.position; pos.x = -1; pos.y = 0.5f; transform.position = pos; GetComponent <TextMesh>().text += "\n Tap to Restart"; } }
// Update is called once per frame void Update() { GameObject bird = GameObject.Find("Blue_Bird3"); birdMove targetScript = bird.GetComponent <birdMove>(); start1 = targetScript.start; if (!dead1 && start1) { Vector3 pos = transform.position; pos.x -= v1 * Time.deltaTime; transform.position = pos; if (transform.position.x <= -15) { Vector3 pos1 = transform.position; pos1.x = coordinate.x; transform.position = pos1; } dead1 = targetScript.dead; } }