void Update() { Text High_Score = GameObject.Find("Canvas/High_Score").GetComponent <Text>(); High_Score.text = "High Score : " + BirdyFly.HighScore(); Debug.Log("High score : " + BirdyFly.HighScore()); }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player" && gameObject.tag == "GreenBall") { BirdyFly birdy = other.GetComponent <BirdyFly>(); if (birdy != null) { birdy.IncreaseScore(); } transform.position = new Vector3(15f, transform.position.y, 0); } }