public static void DispMapStats(int[,] stats)
    {
        float total = MapConst.MAP_WIDTH * MapConst.MAP_HEIGHT;

        GUILayout.Label("camp\t |  level   |    count    | percent");
        for (int camp = 0; camp < 4; ++camp)
        {
            for (int level = 0; level < 3; ++level)
            {
                GUILayout.Label(string.Format("{0:D4}", camp) + " " + MapTileVO.Camp2String(camp).Substring(0, 4) + "\t" + " | " +
                                string.Format("{0:D5}", level) + " | " +
                                string.Format("{0:D7}", stats[camp, level]) + " | " +
                                stats[camp, level] / total * 100);
            }
        }
        GUILayout.Label("strait     | " +
                        string.Format("{0:D7}", stats[4, 0]) + " | " +
                        stats[4, 0] / total * 100);
        GUILayout.Label("block     | " +
                        string.Format("{0:D7}", stats[4, 1]) + " | " +
                        stats[4, 1] / total * 100);
        GUILayout.Label("neutral  | " +
                        string.Format("{0:D7}", stats[4, 2]) + " | " +
                        stats[4, 2] / total * 100);
    }
Ejemplo n.º 2
0
    SpriteRenderer CreateBlock(MapTileVO tile)
    {
        SpriteRenderer block = GameObjectPool.GetInstance().SpawnGo(blockTmp.gameObject).GetComponent <SpriteRenderer>();

        block.gameObject.name = blockTmp.gameObject.name;

        int blockIdx = Mathf.Clamp(tile.camp1, 0, 2);

        if (tile.blockType == MapBlockType.Mountain)
        {
            block.sprite = mapSprites.Get(MapTileVO.Camp2String(tile.camp) + "_mountain_" + blockIdx);
        }
        else if (tile.blockType == MapBlockType.Forest)
        {
            block.sprite = mapSprites.Get(MapTileVO.Camp2String(tile.camp) + "_tree_" + blockIdx);
        }

        return(block);
    }