private void InitGift() { ballLayer.ShowList(); effectLayer.ShowList(); giftLayer.ShowList(); for (int i = (int)PosMgr.Y_HALF_COUNT; i >= -PosMgr.Y_HALF_COUNT; i--) { for (int j = -(int)PosMgr.X_HALF_COUNT; j <= PosMgr.X_HALF_COUNT; j++) { if (j <= BattleModel.Instance.crtBattle.end_x && j >= BattleModel.Instance.crtBattle.start_x && i < BattleModel.Instance.crtBattle.start_y && i >= BattleModel.Instance.crtBattle.end_y) { GameObject itemGift = giftLayer.CreateBaseItem(j - BattleModel.Instance.crtBattle.start_x, -i + BattleModel.Instance.crtBattle.start_y); itemGift.name = (j - BattleModel.Instance.crtBattle.start_x) + "_" + (-i + BattleModel.Instance.crtBattle.start_y); if (i == BattleModel.Instance.crtBattle.end_y) { itemGift.transform.Find("coin").gameObject.SetActive(false); } else { itemGift.transform.Find("box").gameObject.SetActive(false); } } } } }
private void InitLayers() { ballFgLayer.ShowList(); barrierLayer.ShowList(); for (int i = (int)PosMgr.Y_HALF_COUNT; i >= -PosMgr.Y_HALF_COUNT; i--) { for (int j = -(int)PosMgr.X_HALF_COUNT; j <= PosMgr.X_HALF_COUNT; j++) { if (j <= BattleModel.Instance.crtBattle.end_x && j >= BattleModel.Instance.crtBattle.start_x && i < BattleModel.Instance.crtBattle.start_y && i >= BattleModel.Instance.crtBattle.end_y) { GameObject item = barrierLayer.CreateBaseItem(j, i); item.name = (j - BattleModel.Instance.crtBattle.start_x) + "_" + (-i + BattleModel.Instance.crtBattle.start_y); PosMgr.SetFightWallPos(item.transform, j - BattleModel.Instance.crtBattle.start_x, -i + BattleModel.Instance.crtBattle.start_y, 1); } else { ballFgLayer.CreateBaseItem(j - BattleModel.Instance.crtBattle.start_x, -i + BattleModel.Instance.crtBattle.start_y); } } } InitGift(); }