(スクリプト)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class EnemySpeedUp : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
this.gameObject.SetActive(false);
GameObject[] enemies = GameObject.FindGameObjectsWithTag("EnemyB");
foreach (GameObject e in enemies)
{
e.GetComponent<NavMeshAgent>().speed = 10;
}
}
}
}