private void Start() { bossArea = GetComponent <BossArea>(); foreach (var p in phase) { p.boss.SetPositions(bossArea.movementTargets); } }
public bool getAreaBossEnable(BossArea area) { if (area.enabled == true) { return(true); } else { return(false); } }
private void EnteringBossArea() { // (이 모험가의 level <= 사냥터의 maxLevel)인 사냥터 중 maxLevel이 가장 낮은 걸 찾음. destinationPlace = CombatAreaManager.Instance.FindBossArea(); curBossArea = destinationPlace as BossArea; curBossArea.EnterAdventurer(this.gameObject); destinationPlace = null; // 사용 후에는 비워주기. destinationTileForMove = curBossArea.FindNearestBlank(curTileForMove); destinationTile = destinationTileForMove.GetParent(); curState = State.PathFinding; }
public void desativarArea(BossArea areaBoss) { areaBoss.enabled = false; }
public void ConstructBossArea(int areaNum, int areaIndex, GameObject pointTile) { #region InstantiateStructure() string stageNum = "stage" + SceneManager.GetActiveScene().name; int bossAreaNum = areaNum; //Debug.Log("stageNum : " + stageNum + " areaNum : " + huntingAreaNum); //Debug.Log("디버그2: " + huntingAreaJson[stageNum][huntingAreaNum]["name"]); //Debug.Log("HuntingArea/HuntingAreaPrefabs/" + stageNum + "/" + huntingAreaNum); constructing = (GameObject)Instantiate(Resources.Load("CombatArea/BossAreaPrefabs/" + stageNum + "/" + bossAreaNum.ToString())); constructing.transform.parent = rootCombatAreaObject.transform; //임시 BossArea bossArea = constructing.GetComponent <BossArea>(); bossArea.name = bossAreaJson[stageNum][bossAreaNum]["name"]; // 보스 생성. 우선 번호부터. int bossNum = bossAreaJson[stageNum][bossAreaNum]["bossNum"].AsInt; int challengeLevel = bossAreaJson[stageNum][bossAreaNum]["challengeLevel"].AsInt; int bonus = bossAreaJson[stageNum][bossAreaNum]["bonus"].AsInt; //Debug.Log("bonus : " + bonus); GameObject boss = LoadMonsterFromJson("Boss", bossNum); // 세이브 로드용 bossArea.stageNum = stageNum; bossArea.bossAreaNum = areaNum; bossArea.index = areaIndex; //건설공간 지정 int x = bossAreaJson[stageNum][bossAreaNum]["sitewidth"].AsInt; bossArea.extentWidth = x; int y = bossAreaJson[stageNum][bossAreaNum]["siteheight"].AsInt; bossArea.extentHeight = y; #if DEBUG_CREATE_HA Debug.Log("siteWidth = " + x + ", siteHeight = " + y + ", Extent[0][0] = " + huntingAreaJson[stageNum][huntingAreaNum]["site"][0]); #endif bossArea.extent = new int[x, y]; for (int i = 0; i < x * y; i++) { bossArea.extent[i % x, i / x] = bossAreaJson[stageNum][bossAreaNum]["site"][i].AsInt; } #endregion #region AllocateStructure() // 건설할 건물의 position 설정 constructing.transform.position = pointTile.transform.position; // 문제 생길지도 모름. 수정요망 TileLayer tileLayer = TileMapGenerator.Instance.tileMap_Object.transform.GetChild(0).GetComponent <TileLayer>(); SetBossAreaPoint(pointTile.GetComponent <Tile>()); #endregion #region ConstructStructure() Tile tile = bossArea.point; int[,] extent = bossArea.GetExtent(); constructing.tag = "CombatArea"; // 인덱스 값 넣어줌. bossArea.index = bossAreas.Count; // 리스트에 추가 bossAreas.Add(bossArea); for (int i = 0; i < bossArea.extentHeight; i++) { //string debugStr = ""; for (int j = 0; j < bossArea.extentWidth; j++) { Tile thatTile = tileLayer.GetTileAsComponent(tile.GetX() + j, tile.GetY() + i); //debugStr += " "; //debugStr += extent[j, i]; if (extent[j, i] == 1) { thatTile.SetIsBuildingArea(false); //thatTile.SetIsStructed(true); thatTile.SetIsHuntingArea(true); //디버깅용임시 thatTile.gameObject.GetComponent <SpriteRenderer>().color = new Color(0.5f, 0.5f, 0.5f); // for (int k = 0; k < 4; k++) { bossArea.AddTerritory(thatTile.childs[k]); } } else if (extent[j, i] == 2) //입구 { //thatTile.SetIsStructed(false); //thatTile.SetIsEntrance(true); thatTile.gameObject.GetComponent <SpriteRenderer>().color = new Color(0.5f, 0.5f, 1.0f); //if (thatTile.GetBuildable()) //{ bossArea.addEntrance(thatTile); //} } else if (extent[j, i] == 3) { thatTile.SetIsActive(false); thatTile.gameObject.GetComponent <SpriteRenderer>().color = new Color(0.0f, 0.0f, 0.0f); thatTile.SetIsWall(true); } } //Debug.Log(debugStr); } bossArea.InitBossArea(boss, challengeLevel, bonus); boss.GetComponent <Monster>().SetHabitat(bossArea); constructing = null; #endregion }
//public int index; public BossAreaData(BossArea input) : base(input) { bossAreaNum = input.bossAreaNum; index = input.index; }