private void OnTriggerEnter(Collider other) { if (other.tag == "Death") { print("death"); splineManager.DestroyTheLastX(GameManager.Instance.datas.deathRedo); } if (other.tag == "collectible") { collectibleCount += 1; collectibleText.text = "Collectible : " + collectibleCount.ToString() + "/" + howManyCollectibleYouNeed.ToString(); Destroy(other.gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Death") { SoundManager.Instance.DeathOfCharacter(); print("death"); splineManager.DestroyTheLastX(GameManager.Instance.datas.deathRedo); } if (other.tag == "collectible") { compassMat.DOColor(Color.white, "_EmissionColor", 1.25f).SetLoops(2, LoopType.Yoyo); compassMat.DOColor(Color.white, "_Color", 1.25f).SetLoops(2, LoopType.Yoyo); collectibleCount += 1; collectibleText.text = "Collectible : " + collectibleCount.ToString() + "/" + howManyCollectibleYouNeed.ToString(); SoundManager.Instance.ContactSoundCollectible(); Destroy(other.gameObject); } if (other.tag == "InterestPoint") { SoundManager.Instance.ContactSoundInterestPoint(); } }