Esempio n. 1
0
        private void Start()
        {
            // FieldManager.FieldData temp = new FieldManager.FieldData(16, 16,
            // "WL WL WL WL WL WL WL WL WL WL WL WL WL WL WL WL \n" +
            // "WL PW HL PW PW FR FR FR FR FR SL SL SL LK WL WL \n" +
            // "WL PW PW HL PW FR FR FR FR FR SL SL SL LK FR WL \n" +
            // "WL FR HL FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL TN TN TN TN TN TN TN TN TN TN TN TN TN TN WL \n" +
            // "WL FR FR FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR WL WL FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR WL WL FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL FR FR FR FR FR FR FR FR FR FR FR FR FR FR WL \n" +
            // "WL US US FR FR DS DS FR FR FR FR FR FR FR FR WL \n" +
            // "WL US US FR FR DS DS FR FR FR FR FR FR FR FR WL \n" +
            // "WL WL WL WL WL WL WL WL WL WL WL WL WL WL WL WL ");

            //FieldManager.FieldData temp1 = Common.Data.LoadFieldData();
            // FieldManager.FieldData temp2 = Common.Data.LoadFieldData();
            //FieldManager.FieldData temp = FieldManager.instance.Merge2FieldData(temp1, temp2, new Vector2Int(temp1.width,temp1.height));

            // 청크필드 매니저 선언
            ChunkField chunk = new ChunkField();

            // 청크 맵 생성
            FieldManager.instance.InitField(chunk.GenerateChunkMap(map_size: 3, isAttacked: false));

            // 테스트 파티 생성 (없을시)
            if (GameManager.PartyUnits.Count == 0)
            {
                GameManager.PartyUnits.Add(new Unit(UnitAlliance.Party, UnitSpecies.Human, 2));
                GameManager.PartyUnits.Add(new Unit(UnitAlliance.Party, UnitSpecies.Human, 2));
                GameManager.PartyUnits.Add(new Unit(UnitAlliance.Party, UnitSpecies.Human, 2));
                GameManager.PartyUnits.Add(new Unit(UnitAlliance.Party, UnitSpecies.Human, 2));
            }

            // 게임 시작시 재사용대기시간 초기화
            GameManager.PartyUnits.ForEach(u => u.Skills.ForEach(s => s.WaitingTime = 0));

            // 파티 유닛 최초 소환
            BattleView.SummonPartyUnits();

            // 적 생성
            List <Unit> enemies = new List <Unit>();

            enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            // enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            // enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            // enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            // enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            // enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));
            enemies.Add(new Unit(UnitAlliance.Enemy, UnitSpecies.Human, 1));

            // 적 소환 타일 계산
            List <Tile> enemyTiles = FieldManager.GetBlankFloorTiles(enemies.Count);

            // 적 소환
            for (int i = 0; i < enemies.Count; i++)
            {
                Common.Command.Summon(enemies[i], enemyTiles[i].position);
            }

            // 배틀 설정
            BattleController.SetBattleMode(true);
            BattleView.TurnEndButton.gameObject.SetActive(false);
            BattleController.instance.NextTurnStart();

            // 모든 처리가 끝난 뒤에 애니메이션 재생 가능
            // FadeOutTextView.PlayText();
        }
Esempio n. 2
0
 public static Unit GetUnit(Vector2Int position)
 {
     return(FieldManager.GetTile(position)?.GetUnit());
 }
Esempio n. 3
0
 public static Obtainable GetObtainable(Vector2Int position)
 {
     return(FieldManager.GetTile(position)?.GetObtainable());
 }
Esempio n. 4
0
 private void Awake()
 {
     instance = this;
     tileMap  = GetComponentInChildren <Tilemap>();
 }