コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        timeleft -= Time.deltaTime;
        //5秒おき
        if (timeleft <= 0.0)
        {
            timeleft = 5.0f;
            //新しいユニットが生成されたかチェック
            foreach (var units in StageCtl.UnitList[0])
            {
                if (cpuUnitList.Any(u => u.tgtUnit == units) == false)
                {
                    cpuUnit newUnit = new cpuUnit();
                    newUnit.tgtUnit = units;
                    cpuUnitList.Add(newUnit);
                }
            }
        }


        //Debug.Log("[cpuUnit="+ cpuUnitList.Count +"]");

        //ユニットごとの処理
        //foreach(var cUnit in cpuUnitList){
        for (int i = cpuUnitList.Count() - 1; i >= 0; i--)
        {
            if (cpuUnitList[i].tgtUnit == null)
            {
                cpuUnitList.RemoveAt(i);
                continue;
            }
            UnitObj units = cpuUnitList[i].tgtUnit;
            switch (units.units)
            {
            case Unit.LargeTransport:                                                   /* 大型輸送車 */
                if ((units.works == WorkType.None) && (units.transform.parent == null)) //★要改善!
                /* ユニットが搭載されている */
                {
                    if (units.loadUnits.Count > 0)
                    {
                        switch (units.loadUnits[0].units)
                        {
                        case Unit.OilWell:                                 /* 油井 */
                            /* 油田上に居る場合 */
                            if (map.tileMap[units.pos.x, units.pos.y].getType() == TileType.OilField)
                            {
                                units.doDeployUnit();
                            }
                            else
                            {
                                var u = units.canLoad(cpuUnitList[i].hopeRideShip);
                                if (u != null)
                                {
                                    units.doLoad(u);
                                    units.LastDest              = MapCtl.offset_stg2vec(cpuUnitList[i].cpuTgtPos);
                                    cpuUnitList[i].cWorkType    = CpuWorkType.None;
                                    cpuUnitList[i].hopeRideShip = null;
                                }
                                else
                                {
                                    //
                                    if (cpuUnitList[i].hopeRideShip == null)
                                    {
                                        /* 移動先油田未設定 */
                                        //Debug.Log("cpuUnit["+ i +"].cpuTgtPos = " + cpuUnitList[i].cpuTgtPos +"]");
                                        if (cpuUnitList[i].cpuTgtPos.x == -1)
                                        {
                                            visOil OilObj = visOilList.Where(uu => uu.tgtUnit == null).ToList().Find(s => map.MapDist(cpuUnitList[i].tgtUnit.pos, s.pos) == visOilList.Where(uu => uu.tgtUnit == null).ToList().Min(p => map.MapDist(cpuUnitList[i].tgtUnit.pos, p.pos)));
                                            //if (OilObj){
                                            cpuUnitList[i].cpuTgtPos = OilObj.pos;
                                            OilObj.tgtUnit           = cpuUnitList[i].tgtUnit.loadUnits[0];
                                            //Debug.Log("cpuUnit["+ i +"].cpuTgtPos = " + cpuUnitList[i].cpuTgtPos +"]");
                                            //}
                                        }
                                        /* 開いている最短の油田へ経路探索 */
                                        if ((cpuUnitList[i].cWorkType == CpuWorkType.None) && (cpuUnitList[i].cpuTgtPos.x > -1))
                                        {
                                            srcOil(cpuUnitList[i]);
                                            cpuUnitList[i].hopeRideShip = null;
                                            Debug.Log("srcOil cpuUnit[" + i + "].cpuTgtPos = " + units.pos + " ->" + cpuUnitList[i].cpuTgtPos + "]");
                                            //units.doMove(map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.OilField, TileType.None)[0]);
                                        }
                                    }
                                    else
                                    {
                                        units.doMove(cpuUnitList[i].hopeRideShip.pos);
                                    }
                                }
                            }
                            break;

                        case Unit.NavalPort:                                 /* 軍港 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.ShallowSea);
                                units.doMove(clist[0]);
                            }
                            break;

                        case Unit.Airfield:                                 /* 飛行場 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.Meadow);
                                units.doMove(clist[0]);
                            }
                            break;

                        case Unit.Factory:                                 /* 工場 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.ShallowSea);
                                units.doMove(clist[0]);
                            }
                            break;

                        case Unit.Refinery:                                 /* 製油所 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.ShallowSea);
                                units.doMove(clist[0]);
                            }
                            break;

                        case Unit.Camp:                                 /* 野営地 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.ShallowSea);
                                units.doMove(clist[0]);
                            }
                            break;

                        case Unit.Base:                                 /* 基地 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.ShallowSea);
                                units.doMove(clist[0]);
                            }
                            break;

                        case Unit.Fortress:                                 /* 要塞 */
                            if (units.doDeployUnit() == false)
                            {
                                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.ShallowSea);
                                units.doMove(clist[0]);
                            }
                            break;

                        default:                                 /* その他 */
                            break;
                        }
                        /* ユニットが未搭載 */
                    }
                    else
                    {
                    }
                }
                break;

            case Unit.TransportShip:             /* 輸送艦 */
                if (units.works == WorkType.None)
                {
                    /* ユニットが搭載されている */
                    if (units.loadUnits.Count > 0)
                    {
                        if (units.loadUnits[0].works == WorkType.Loading)
                        {
                            //搭載ユニットの最終移動先へ
                            units.doMove(MapCtl.offset_vec2stg(units.loadUnits[0].LastDest));
                            units.loadUnits[0].works = WorkType.None;
                        }
                        else
                        {
                            if (map.tileRing(units.pos, 1).Exists(tll => (((map.tileMap[tll.x, tll.y].getGroup() == TileGroup.Ground)))))
                            {
                                units.doUnload(units.loadUnits[0]);
                                cpuUnitList[i].hopeRideShip = null;
                            }
                            else
                            {
                                units.doMove(MapCtl.offset_vec2stg(units.loadUnits[0].LastDest));
                            }
                        }
                        /* ユニットが非搭載 */
                    }
                    else
                    {
                        //陸地に隣接している場合
                        if (map.tileRing(units.pos, 1).Exists(tll => (((map.tileMap[tll.x, tll.y].getGroup() == TileGroup.Ground)))))
                        {
                            /* 待機 */
                        }
                        else
                        {
                            //ランダムな首都を目指す(デバッグ用)
                            //units.doMove(UnitList.Where(u => u.units == Unit.Capital ).OrderBy(j => System.Guid.NewGuid()).ToList()[0].pos);
                            //ランダムな支配下領域を目指す
                            //units.doMove(map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None).FirstOrDefault(t=>cpuTileMap[t.x, t.y].domain>0));
                        }
                    }
                }
                break;

            case Unit.Surveillance:             /* 偵察機 */
                if (units.works == WorkType.None)
                {
                    units.doMove(new Vector2Int(3, 3));
                    units.addMove(new Vector2Int(15, 15));
                }

                /* 帰還チェック */
                chkReturn(units);

                break;

            case Unit.LandFighter:             /* 陸上戦闘機 */
                if (units.works == WorkType.None)
                {
                    units.doMove(new Vector2Int(3, 3));
                    units.addMove(new Vector2Int(15, 15));
                }

                /* 帰還チェック */
                chkReturn(units);

                break;

            case Unit.Fighter:             /* 戦闘機 */
                if (units.works == WorkType.None)
                {
                    units.doMove(new Vector2Int(3, 3));
                    units.addMove(new Vector2Int(15, 15));
                }

                /* 帰還チェック */
                chkReturn(units);

                break;

            case Unit.Capital:             /* 首都 */
                if (units.works == WorkType.None)
                {
                    //if (UnitList.Where( u => u.units == Unit.NavalPort ).ToList().Count < 1) {
                    //	//units.bldNavalPort();
                    //	units.doBuildUnit(Unit.NavalPort);
                    //} else if (UnitList.Where( u => u.units == Unit.OilWell ).ToList().Count < 5){
                    //	//units.bldOilWell();
                    //	units.doBuildUnit(Unit.OilWell);
                    //} else
                    if (UnitList.Where(u => u.units == Unit.Airfield).ToList().Count < 1)
                    {
                        units.doBuildUnit(Unit.Airfield);
                    }
                }
                break;

            case Unit.Factory:             /* 工場 */
                break;

            case Unit.NavalPort:             /* 軍港 */

                //Debug.Log("NavalPort!! "+ units.works);
                if (units.works == WorkType.None)
                {
                    if (UnitList.Where(u => u.units == Unit.TransportShip).ToList().Count < 3)
                    {
                        units.doBuildUnit(Unit.TransportShip);
                    }
                    else if (UnitList.Where(u => u.units == Unit.LargeTanker).ToList().Count < 5)
                    {
                        units.doBuildUnit(Unit.LargeTanker);
                    }
                }
                break;

            case Unit.Airfield:             /* 飛行場 */
                if (units.works == WorkType.None)
                {
                    if (UnitList.Where(u => u.units == Unit.Surveillance).ToList().Count < 2)                         /* 偵察機 */
                    {
                        units.doBuildUnit(Unit.Surveillance);
                    }
                    else if (UnitList.Where(u => u.units == Unit.LandFighter).ToList().Count < 5)                          /* 陸上戦闘機 */
                    {
                        units.doBuildUnit(Unit.LandFighter);
                    }
                }
                break;

            case Unit.Camp:             /* 工場 */
                break;

            case Unit.Base:             /* 軍港 */
                break;

            default:             /* 資源・その他 */
                //units.bldOilWell();
                break;
            }

            //
        }
    }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        ast = gameObject.GetComponent <astar>();

        //乱数初期化
        float _seed1X = UnityEngine.Random.value * 100f;
        float _seed1Y = UnityEngine.Random.value * 100f;
        float _seed2X = UnityEngine.Random.value * 100f;
        float _seed2Y = UnityEngine.Random.value * 100f;

        //マップ初期化
        map.initTile();
        for (int x = 0; x < TileLenX; x++)
        {
            for (int y = 0; y < TileLenY; y++)
            {
                if ((x == 0) || (y == 0) || (x == TileLenX - 1) || (y == TileLenY - 1))
                {
                    map.putTile(TileType.DeepSea, x, y);                     //深い海
                    //} else if (( x == 1 )||( y == 1 )||( x == TileLenX-2 )||( y == TileLenY-2 )){
                    //	map.putTile(TileType.DeepSea, x, y); //浅い海
                }
                else
                {
                    //var rand = UnityEngine.Random.Range(0, 6);
                    float noise = Mathf.PerlinNoise(((float)x + _seed1X) / ((float)TileLenX / 25.0f), ((float)y + _seed1Y) / ((float)TileLenX / 25.0f)) + Mathf.PerlinNoise(((float)x + _seed2X) / ((float)TileLenX / 10.0f), ((float)y + _seed2Y) / ((float)TileLenX / 10.0f));
                    //Debug.Log(noise);
                    int   rand  = 0;
                    float tmp_x = ((float)x - (float)TileLenX / 2.0f) / (float)TileLenX * 2.0f;
                    float tmp_y = ((float)y - (float)TileLenY / 2.0f) / (float)TileLenY * 2.0f;
                    //Debug.Log(tmp_x);
                    rand = (int)(noise * 10.0f + 2.0f * Mathf.Min(2.0f * Mathf.Cos(15.0f * tmp_x) + Mathf.Cos(9.0f * tmp_x), 1.0f) + 1.0f * Mathf.Min(2.0f * Mathf.Cos(9.0f * tmp_y) + Mathf.Cos(3.0f * tmp_y), 1.0f));
                    //Debug.Log(((float)x - (float)TileLenX/2.0f)/(float)TileLenX*2.0f);

                    //if (x < TileLenX/4) {
                    //	rand = (int)(noise * 15 - (Mathf.Abs((float)x - (float)TileLenX/7.0f) )/((float)TileLenX/25.0f));
                    //} else if (x < TileLenX/4*3) {
                    //	rand = (int)(noise * 15 - (Mathf.Abs((float)x - (float)TileLenX/2.0f) )/((float)TileLenX/25.0f));
                    //} else {
                    //	rand = (int)(noise * 15 - (Mathf.Abs((float)x - (float)TileLenX/7.0f*6.0f) )/((float)TileLenX/25.0f));
                    //}
                    if (rand < 11)
                    {
                        map.putTile(TileType.DeepSea, x, y);         //深い海
                    }
                    else if (rand < 13)
                    {
                        map.putTile(TileType.ShallowSea, x, y);         //浅い海
                    }
                    else if (rand < 14)
                    {
                        if ((x < 4) || (y < 4) || (x > TileLenX - 5) || (y > TileLenY - 5))
                        {
                            map.putTile(TileType.ShallowSea, x, y);                             //浅い海
                        }
                        else
                        {
                            map.putTile(TileType.SandyBeach, x, y);     //草地
                        }
                    }
                    else if (rand < 16)
                    {
                        map.putTile(TileType.Meadow, x, y);                         //砂地
                    }
                    else if (rand < 18)
                    {
                        map.putTile(TileType.Forest, x, y);                         //砂地
                    }
                    else
                    {
                        if ((x < 5) || (y < 5) || (x > TileLenX - 4) || (y > TileLenY - 4))
                        {
                            map.putTile(TileType.ShallowSea, x, y);     //浅い海
                        }
                        else
                        {
                            map.putTile(TileType.Mountain, x, y);                             //山
                        }
                    }
                }
            }
        }

        //資源設定
        for (int x = 0; x < 4; x++)
        {
            for (int y = 0; y < 3; y++)
            {
                map.setRandfuel(TileLenX / 5 * x, TileLenX / 5 * (x + 1), TileLenY / 3 * y, TileLenY / 3 * (y + 1), 3);
            }
        }

        //プレイヤー情報登録
        players.Add(new PlayerCtl("テスト1", 1, 0, new Color(0.75f, 0.0f, 0.0f, 1.0f))); teamnum++;
        players[0].vMap = new ViewMap(null, vmap);
        //UnitList.Add(new List<UnitObj>());
        //UcList[0].Add(new uCost());
        ;


        players.Add(new PlayerCtl("テスト2", 0, 1, new Color(0.0f, 0.0f, 0.75f, 1.0f))); teamnum++;
        players[1].vMap = new ViewMap(null, null);
        //UnitList.Add(new List<UnitObj>());

        uCost.initUcost(teamnum);
        Debug.Log("uCost[" + uCost.fuel(0, Unit.LargeTransport) + "]");
        /* プレイヤー番号, ユニット種別, 燃料, 金, 時間, 生産者, 親 */
        uCost.setUcost(0, Unit.OilWell, 10, 100, 100, Unit.Capital, Unit.LargeTransport);
        uCost.setUcost(0, Unit.NavalPort, 10, 100, 100, Unit.Capital, Unit.LargeTransport);
        uCost.setUcost(0, Unit.Airfield, 10, 100, 100, Unit.Capital, Unit.LargeTransport);
        uCost.setUcost(0, Unit.TransportShip, 10, 100, 100, Unit.NavalPort, null);
        uCost.setUcost(0, Unit.LargeTanker, 10, 100, 100, Unit.NavalPort, null);
        uCost.setUcost(0, Unit.Surveillance, 10, 100, 100, Unit.Airfield, null);
        uCost.setUcost(0, Unit.LandFighter, 10, 100, 100, Unit.Airfield, null);
        Debug.Log("uCost[" + uCost.fuel(0, Unit.LargeTransport) + "]");
        uCost.chgUcost(0, Unit.LargeTransport, 50, 50, 50);
        Debug.Log("uCost[" + uCost.fuel(0, Unit.LargeTransport) + "]");

        //首都
        for (int x = 4; x < 5; x++)
        {
            for (int y = 1; y < 2; y++)
            {
                List <Vector2Int> clist = map.getSpcTilePos(new Vector2Int(TileLenX / 5 * x, TileLenY / 3 * y), new Vector2Int(TileLenX / 5 * (x + 1), TileLenY / 3 * (y + 1)), TileType.Meadow, TileType.Meadow);
                if (clist.Count > 0)
                {
                    //Debug.Log("["+ clist.Count+"]");
                    AddUnit("AAA", new Vector2Int(clist[0].x, clist[0].y), players[0], Unit.Capital);
                    AddUnit("AAA", new Vector2Int(clist[1].x, clist[1].y), players[0], Unit.Fighter);
                }
                else
                {
                    Debug.LogError("[" + clist.Count + "]");
                }
            }
        }
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.Meadow, TileType.None)[0], players[0], Unit.LargeTransport);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , new Vector2Int(55,55), players[1], Unit.Tank);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        //AddUnit("AAA" , map.getSpcTilePos(new Vector2Int(0,0), new Vector2Int (StageCtl.TileLenX, StageCtl.TileLenY), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);
        AddUnit("AAA", map.getSpcTilePos(new Vector2Int(StageCtl.TileLenX - 10, TileLenY / 3), new Vector2Int(StageCtl.TileLenX, StageCtl.TileLenY / 3 * 2), TileType.DeepSea, TileType.None)[0], players[0], Unit.TransportShip);

        List <Vector2Int> clist2 = map.getSpcTilePos(new Vector2Int(0, 0), new Vector2Int(TileLenX, TileLenY), TileType.Meadow, TileType.ShallowSea);
        //ast.getRoute(map.chkAdjTileType(clist2[0], 1)[0], map.chkAdjTileType(clist2[1], 1)[0], map.tileMap, 0, TapCbs); //A-Sterによる経路取得

        List <Vector2Int> clist3 = map.tileRing(new Vector2Int(30, 30), 5);

        //TapCbs(clist3);

        //ast.getRoute(clist2[0], clist2[1], map.tileMap, 0, TapCbs);
        //Debug.Log("["+ clist2[0] +"/"+ clist2[1] +"]");

        Debug.Log("[" + map.MapDist(new Vector2Int(10, 10), new Vector2Int(11, 10)));
    }