private void OnTriggerEnter(Collider col) { if (isTargetAbleToBeHit) { material.color = Color.green; HitMetrics hitMetrics = FindObjectOfType <HitMetrics>(); hitMetrics.IncrementHitCount(targetName); targetTransform.position += Vector3.forward * impactMovement; isTargetAbleToBeHit = false; StartCoroutine(TargetWasHitCoroutine()); } }
// Use this for initialization void Start() { text = GetComponent <Text>(); hitMetrics = FindObjectOfType <HitMetrics>(); }