public void UpdateCoinsUIText() { for (int i = 0; i < coinsUIText.Length; i++) { SetCoinsText(coinsUIText[i], GameDataMF.GetCoins()); } }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "bullet") { Auds.PlayOneShot(audClip); Debug.Log("working"); GameDataManager.AddCoins(1); // Cheating (while moving hold key "C" to get extra coins) #if UNITY_EDITOR if (Input.GetKey(KeyCode.C)) { GameDataManager.AddCoins(179); } #endif GameSharedUI.Instance.UpdateCoinsUIText(); Destroy(gameObject); } if (col.tag == "bullet1") { Debug.Log("dd"); Auds.PlayOneShot(audClip); Destroy(gameObject); GameDataMF.AddCoins(1); // Cheating (while moving hold key "C" to get extra coins) #if UNITY_EDITOR if (Input.GetKey(KeyCode.C)) { GameDataMF.AddCoins(179); } #endif GameSUIF.Instance.UpdateCoinsUIText(); } if (col.tag == "bullet2") { Debug.Log("dd"); Auds.PlayOneShot(audClip); Destroy(gameObject); GameDataMH.AddCoins(1); // Cheating (while moving hold key "C" to get extra coins) #if UNITY_EDITOR if (Input.GetKey(KeyCode.C)) { GameDataMH.AddCoins(179); } #endif GameSUIH.Instance.UpdateCoinsUIText(); } if (col.tag == "bullet3") { Debug.Log("dd"); Auds.PlayOneShot(audClip); Destroy(gameObject); } }