public void GeneratePathToPosition(Vector3 pos)
    {
        OnPathFound = OnIndoorPathFound;
        Vector3 pos_ = new Vector3(pos.x, customer.modelHeight, pos.z);

        DispensaryPathRequestManager.RequestPath(customer.dm.dispensary.grid, transform.position, pos_, OnPathFound);
    }
    /*public delegate void OnPathfindingArrival();
     * public OnPathfindingArrival OnArrival;
     * public void SetOnArrival(OnPathfindingArrival del)
     * {
     *  OnArrival += del;
     *  print("Setting onarrival");
     * }*/

    public void GetIndoorPath(Vector3 pos, Func <bool> onArrival)
    {
        Vector3 pos_ = new Vector3(pos.x, .5f, pos.z);

        DispensaryPathRequestManager.RequestPath(driver.dm.dispensary.grid, transform.position, pos, OnPathFound);
        OnArrival = onArrival;
    }
    public void GeneratePathToExitDoorway()
    {
        StoreObjectFunction_Doorway       door    = customer.dm.dispensary.Main_c.GetRandomEntryDoor();
        Func <Vector3[], bool, Vector3[]> getPath = OnIndoorPathFound;

        DispensaryPathRequestManager.RequestPath(customer.dm.dispensary.grid, transform.position, door.transform.position, getPath);
    }
예제 #4
0
    public void GeneratePathToComponent(string targetComponent)
    {
        Func <Vector3[], bool, Vector3[]> getPath = OnPathFound_ToPosition;
        Vector3 targetPos = staff.dm.GetDoorwayPosition(targetComponent, transform.position);

        DispensaryPathRequestManager.RequestPath(staff.dm.dispensary.grid, transform.position, targetPos, getPath);
    }
예제 #5
0
    public void GeneratePathToPosition(Vector3 pos, OnPathfindingArrival onArrival)
    {
        Func <Vector3[], bool, Vector3[]> getPath = OnPathFound_ToPosition;
        Vector3 pos_ = new Vector3(pos.x, staff.modelHeight, pos.z);

        DispensaryPathRequestManager.RequestPath(staff.dm.dispensary.grid, transform.position, pos, getPath);
        SetOnArrival(onArrival);
    }
예제 #6
0
    public void GeneratePathToPosition(Vector3 pos)
    {
        Func <Vector3[], bool, Vector3[]> getPath = OnPathFound_ToPosition;

        if (staff == null)
        {
            staff = GetComponent <Staff>();
        }
        Vector3 pos_ = new Vector3(pos.x, staff.modelHeight, pos.z);

        DispensaryPathRequestManager.RequestPath(staff.dm.dispensary.grid, transform.position, pos, getPath);
    }
예제 #7
0
 void Start()
 {
     try
     {
         if (!called)
         {
             Database db = GameObject.Find("Database").GetComponent <Database>();
             instance = gameObject.GetComponent <DispensaryPathRequestManager>();
             if (db == null)
             {
                 throw new NullReferenceException();
             }
         }
         called = true;
     }
     catch (NullReferenceException)
     {
         called = false;
         // Game is loading, do nothing here
     }
 }
 void Awake()
 {
     requestManager = GetComponent <DispensaryPathRequestManager>();
     //grid = GetComponent<Grid>();
 }