示例#1
0
文件: Target.cs 项目: aggdotred/MFT
 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());
     }
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     text       = GetComponent <Text>();
     hitMetrics = FindObjectOfType <HitMetrics>();
 }