Пример #1
0
    public void Generate()
    {
        float startTime = DateTime.Now.Millisecond;

        if (UseCanonicalDij)
        {
            NavUtils.GenerateCanonicalDijkstraIntegratField(MapColliderInfo.GameMap, Target);
        }
        else
        {
            NavUtils.GenerateDijkstraIntegratField(MapColliderInfo.GameMap, Target);
        }
        NavUtils.GenerateFlowField(MapColliderInfo.GameMap, Target);

        // for (int y = 0; y < GameSetting.MAP_HEIGHT; y++)
        // {
        //     for (int x = 0; x < GameSetting.MAP_WIDTH; x++)
        //     {
        //         int idx = y * GameSetting.MAP_WIDTH + x;

        //         float value = MapColliderInfo.GameMap.IntegrationField[x, y];

        //         if (value == float.MaxValue)
        //         {
        //             _texts[idx].text = "INF";
        //         }
        //         else
        //         {
        //             _texts[idx].text = string.Format ("{0:F1}", value);
        //         }
        //     }
        // }
    }