Beispiel #1
0
 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());
     }
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     text       = GetComponent <Text>();
     hitMetrics = FindObjectOfType <HitMetrics>();
 }