コード例 #1
0
 private void OnTriggerStay(Collider col)
 {
     if (col.gameObject.tag == playerTag)
     {
         if (timer >= attackCooldown)
         {
             TowerStats stats = col.gameObject.GetComponent <TowerStats>();
             stats.Hit(damage);
             enemyStats.Hit(damage);
             timer = 0;
         }
     }
     timer += Time.deltaTime;
 }