public void Die() { DeathExplosion deathExplosion = Instantiate(deathExplosionPrefab).GetComponent <DeathExplosion>(); deathExplosion.transform.position = this.transform.position; deathExplosion.SetColor(color); Destroy(this.gameObject); }
protected void RpcColor(GameObject obj, Color color) { obj.GetComponent <Renderer>().material.color = color; DeathExplosion deathExplosion = obj.GetComponentInChildren <DeathExplosion>(); deathExplosion?.SetColor(color); m_headController?.SetColor(color); m_gun?.SetColor(color); }