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); }
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); }
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); }
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); }
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>(); }