public void addCurrentScore(int a) { currentScore += a; GameObject pecky = GameObject.FindGameObjectWithTag("pecky"); GameObject scoreNotif = GameObject.Instantiate(scoreNotification, pecky.transform.position, pecky.transform.rotation); TextMesh textmesh = scoreNotif.GetComponent <TextMesh>(); textmesh.text = a.ToString(); StartCoroutine(StaticTools.NotifyCollectible(scoreNotif, 10)); updateCurrentScore(); }
private void revealItem() { GameObject item = null; //For now, juz +1 Life MainSceneManager mainSceneManager = MainSceneManager.getMainSceneManager(); if (mainSceneManager.addLife()) { item = GameObject.Instantiate(lifePrefab, transform.position, transform.rotation); AudioSource audioSource = GetComponent <AudioSource>(); audioSource.Play(); } if (item != null) { StartCoroutine(StaticTools.NotifyCollectible(item, 10)); } }