private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Attack_Area") { enemy.Chase = false; enemy.Animation_Controller.TriggerAttack(); } if (other.gameObject.tag == "Enemy_T01" || other.gameObject.tag == "VFX") { if (other.gameObject.tag == "VFX") { UIController.IncreaseScore(scoreValue); ScoreMark.SpawnScoreMark(scoreValue, gameObject); VFXManager.SpawnConfetti(transform); SoundManager.PlaySFX("Die", transform); } if (other.gameObject.tag == "Enemy_T01") { VFXManager.SpawnConfetti(transform); SoundManager.PlaySFX("Despawn", transform); } Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "RotationPos") { transform.parent = other.gameObject.transform; other.gameObject.GetComponent <Collider>().enabled = false; } else if (other.gameObject.name == "Attack_Area") { if (enemy.Chase) { enemy.Chase = false; enemy.Escape = true; } } if (other.gameObject.tag == "Enemy_T03" || other.gameObject.tag == "VFX") { if (other.gameObject.tag == "VFX") { UIController.IncreaseScore(scoreValue); ScoreMark.SpawnScoreMark(scoreValue, gameObject); } VFXManager.SpawnConfetti(transform); SoundManager.PlaySFX("Die", transform); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.name == "Crystal") { return; } if (gameObject.tag == "InteractiveObject" && other.gameObject.tag == "VFX") { VFXManager.SpawnConfetti(transform); SoundManager.PlaySFX("Item", transform); ScoreMark.SpawnScoreMark((int)ScoreValue.Coin, gameObject); Destroy(gameObject); } }