示例#1
0
    void CheckInit()
    {
        if (NavMesh != null)
        {
            return;
        }

        var _mapId = int.Parse(SceneManager.GetActiveScene().name.Replace("map", ""));
        var txt    = Resources.Load <TextAsset>("Maps/" + _mapId + ".navmesh");

        NavMesh = new TriangleNavMesh(txt.text);
        if (lineRenderer == null)
        {
            lineRenderer = GetComponentInChildren <LineRenderer>();
        }
        resultMesh   = CreateMeshGo("PathMesh", 1.0f);
        progressMesh = CreateMeshGo("ProgressMesh", 0.5f);
        allMesh      = CreateMeshGo("AllMesh", 0.2f);
    }
示例#2
0
 public static void DoInit(string data)
 {
     NavMesh = new TriangleNavMesh(data);
 }