void OnTriggerEnter2D(Collider2D col) { if ((col.gameObject.tag == "Doggo" || col.gameObject.tag == "DoggoParticle") && _player.Attacking()) { RunDoggo script = col.gameObject.GetComponent <RunDoggo>(); script.Killed(); _scoring.AddScore(10); if (col.gameObject.tag == "DoggoParticle") { _player.AddStamina(50); } Instantiate(_explosion, new Vector3(1.995f, 0.256f, 0), Quaternion.identity); } }
protected void ChangeText(Text theText, string displayed, int font, Color color, int score) { theText.text = displayed; theText.fontSize += font; theText.color = color; scoring.AddScore(score); }
// Start is called before the first frame update private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { Destroy(this.gameObject); scoring.AddScore(1); } }