void OnTriggerEnter(Collider col) { GameObject hitObj = col.gameObject; if (hitObj != null) { if (hitObj.CompareTag("Tile")) { hitObj.GetComponent <Tile>().TakeProjectile(gameObject, this); metrics.setTilesPainted(myPlayerID, 1); } else if (hitObj.CompareTag("Tower")) { Instantiate(hitPref, transform.position, transform.rotation); hitObj.GetComponent <Tower>().TakeProjectile(gameObject, this); //metrics.setTimesTowerIsPainted(1, 1); Destroy(gameObject); } else if (hitObj.CompareTag("Player")) { Instantiate(hitPref, transform.position, transform.rotation); hitObj.GetComponent <PlayerController>().myHealth.ChangeHealth(-damageAmount); metrics.setPlayersPainted(myPlayerID, 1); Destroy(gameObject); } else if (hitObj.CompareTag("Shield")) { if (hitObj.gameObject.GetComponent <ShieldController>().mColorstate != myPaintState) { Destroy(gameObject); } } else if (hitObj.CompareTag("Base")) { Instantiate(hitPref, transform.position, transform.rotation); col.gameObject.GetComponent <Health>().ChangeHealth(-damageAmount); //metrics.setTimesTowerIsPainted(1, 1); Destroy(gameObject); } } //Instantiate(paintSplatPref, transform.position, transform.rotation); ///TODO/// //SpawnSplat }