private void Boosts_Load(object sender, EventArgs e) { ColourChanger.Enabled = true; ColourChanger.Start(); MoneyCount.Enabled = true; MoneyCount.Start(); }
void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Base" || collider.tag == "ColourChanger") { return; } if (collider.tag == "Point") { score++; text.text = score.ToString(); Destroy(collider.gameObject); return; } if (collider.tag != currentColour) { Time.timeScale = 0; Advertisement.Show(); back.pause = true; PlayerPrefs.SetInt("Collection", score); //Debug.Log("Saved"); Destroy(gameObject); //SceneManager.LoadScene(SceneManager.GetActiveScene().name, LoadSceneMode.Single); } if (collider.tag == currentColour) { if (flappy || pingpong || bounce) { ColourChanger changer = FindObjectOfType <ColourChanger>(); changer.SetRandomColour(gameObject.GetComponent <Collider2D>()); score++; text.text = score.ToString(); } } }