Exemplo n.º 1
0
    public static int GetPath(Vector3 entry, Vector3 exit, float tolerance = 5f)
    {
        // main.StartCoroutine(main.FindPath(entry, exit, tolerance));

        NavPathRequest r = new NavPathRequest(entry, exit, tolerance);
        int            t = ThreadRunner.CreateThread(new ParameterizedThreadStart(main.ThreadFindPathObject), (object)r);

        Debug.Log("Created pathing thread #" + t);

        ThreadRunner.StartThread(t);
        return(t);
    }
Exemplo n.º 2
0
    public void ThreadFindPathObject(object o)
    {
        if (o.GetType() != typeof(NavPathRequest))
        {
            ThreadRunner.ExportData(null);
            ThreadRunner.MarkComplete();
            return;
        }
        NavPathRequest r = (NavPathRequest)o;

        ThreadFindPath(r.entry, r.exit, r.tolerance);
    }