Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.TryGetComponent(out Enemy enemy))
     {
         OnReached.Invoke(enemy);
     }
 }
Ejemplo n.º 2
0
    void CheckArrival()
    {
        var distance = Vector3.Distance(transform.position, target.position + offset);

        if (distance < eps)
        {
            OnReached?.Invoke();
        }
    }
    //到着判定
    void CheckArrival()
    {
        if (!isArrived)
        {
            return;
        }
        var distance = Vector3.Distance(transform.position, targetHouse.transform.position + offset);

        if (distance < eps)
        {
            GetComponent <Movement>().isActive = false;
            isArrived = true;
            OnReached?.Invoke();
        }
    }
Ejemplo n.º 4
0
 public void OnLocationReached()
 {
     OnReached?.Invoke();
 }