public Transform target; //プレイヤーの位置
static Vector3 pos;
NavMeshAgent agent;

float agentToPatroldistance;
float agentToTargetdistance;

void Awake()
{
agent = GetComponent<NavMeshAgent>();
}


void Start()
{
DoPatrol();
}


void Update()
{
//Agentと目的地の距離
agentToPatroldistance = Vector3.Distance(this.agent.transform.position, pos);