コード例 #1
0
ファイル: SplinePlus.cs プロジェクト: JKDaluga/AlmostRace
    public void PFFindPath(Follower agent, PathFindingGoal pFGoal)
    {
        //Debug.Log("here");
        Type myType = null;

        try
        {
            myType = Type.GetType("PathFinding");
        }
        catch
        {
            myType = null;
            SPData.FollowerType = FollowerType.Simple;
        }
        if (myType != null)
        {
            object     instance = Activator.CreateInstance(myType);
            MethodInfo myMethod = myType.GetMethod("FindAgentShortestPathToGoal");
            if (myMethod != null)
            {
                myMethod.Invoke(instance, new object[] { SPData, agent, pFGoal });
            }
            else
            {
                Debug.Log("Method FindShortestPathDijkstra not found");
            }
        }
        else
        {
            Debug.Log(" Path finding package is not found");
        }
    }
コード例 #2
0
ファイル: SplinePlus.cs プロジェクト: JKDaluga/AlmostRace
    IEnumerator PFFollowerUpdatePath(Follower agent, PathFindingGoal pFGoal)
    {
        yield return(new WaitForSeconds(agent.UpdateTime));

        PFFindPath(agent, pFGoal);
    }