/// <summary> 메인퀘스트 셋팅 함수 </summary> void SetMainItem(Transform tf, QuestInfo questInfo) { Quest.QuestInfo lowData = _LowDataMgr.instance.GetLowDataQuestData(questInfo.unTaskId); tf.FindChild("Title/Txt_title").GetComponent <UILabel>().text = lowData.Title; //제목 tf.FindChild("Detail/Txt_info").GetComponent <UILabel>().text = lowData.Description; //내용 int count = 0; //아이템있다 if (0 < lowData.rewardItem) { List <GatchaReward.FixedRewardInfo> infoList = _LowDataMgr.instance.GetFixedRewardItemGroupList(lowData.rewardItem); byte myClass = 1; //장비만 직업이다르므로 if (infoList[0].Type == 12) { if (NetData.instance.GetUserInfo().GetCharIdx() == 12000) { myClass = 2; } else if (NetData.instance.GetUserInfo().GetCharIdx() == 13000) { myClass = 3; } } else { myClass = 99; } //내 직업과맞는걸 넣어줘라 GatchaReward.FixedRewardInfo info = new GatchaReward.FixedRewardInfo(); for (int i = 0; i < infoList.Count; i++) { if (infoList[i].ClassType != myClass) { continue; } info = infoList[i]; } tf.FindChild("Reward/item").localPosition = RewardPos[count++]; InvenItemSlotObject slot = null; if (0 < tf.FindChild("Reward/item").childCount) { slot = tf.FindChild("Reward/item").GetChild(0).GetComponent <InvenItemSlotObject>(); } else { GameObject go = UIHelper.CreateInvenSlot(tf.FindChild("Reward/item")); go.collider.enabled = false; slot = go.GetComponent <InvenItemSlotObject>(); } slot.SetLowDataItemSlot(info.ItemId == 0 ? info.Type : info.ItemId, info.ItemCount); UIEventTrigger etri = tf.FindChild("Reward/item").GetComponent <UIEventTrigger>(); EventDelegate.Set(etri.onClick, delegate() { //UIMgr.OpenClickPopup(info.ItemId, tf.FindChild("Reward/item").transform.position); UIMgr.OpenDetailPopup(this, info.ItemId); }); tf.FindChild("Reward/item").gameObject.SetActive(true); } else { tf.FindChild("Reward/item").gameObject.SetActive(false); } if (SetRewardTf(tf.FindChild("Reward/gold"), lowData.rewardGold, false)) { tf.FindChild("Reward/gold").localPosition = RewardPos[count++]; } if (SetRewardTf(tf.FindChild("Reward/exp"), lowData.rewardExp, true)) { tf.FindChild("Reward/exp").localPosition = RewardPos[count++]; } if (QuestManager.instance.GetCurrentQuestInfo().unTaskId != questInfo.unTaskId) { bool isEndQuest = false, isReward = false, isGoto = false; if (questInfo.unComplete == 1) //클리어 { if (questInfo.unFetchBonus == 0) //미수령 { isReward = true; } else//수령 { isEndQuest = true; } } else if (lowData.value != 0)//미 클리어(진행중?) { isGoto = true; //tf.FindChild("slider/value").GetComponent<UILabel>().text = string.Format("{0} / {1}", questInfo.unTargetNum, lowData.value); //tf.FindChild("slider/filled").GetComponent<UISprite>().fillAmount = questInfo.unTargetNum / lowData.value; } //tf.FindChild("Clear").gameObject.SetActive(isEndQuest); tf.FindChild("BtnReward").gameObject.SetActive(isReward); //tf.FindChild("slider").gameObject.SetActive(isGoto); tf.FindChild("BtnGoto").gameObject.SetActive(isGoto); } else//진행중인 미션임. 이거는 버튼이 활성화 되지 않이함. { //tf.FindChild("Clear").gameObject.SetActive(false); tf.FindChild("BtnReward").gameObject.SetActive(false); //tf.FindChild("slider").gameObject.SetActive(false); tf.FindChild("BtnGoto").gameObject.SetActive(false); } }
private List <QuestInfo> SubQuestList = new List <QuestInfo>(); //메인에 위치할 퀘스트 리스트 //private ViewType CurViewType; public override void Init() { base.Init(); EventDelegate.Set(BtnClose.onClick, Close); TabGroup.Initialize(OnClickTab); Empty.SetActive(false); //일단끄고시작 GridTf[0].gameObject.SetActive(false); //메인or서브 퀘스트 찾기. var enumerator = QuestManager.instance.QuestList.GetEnumerator(); while (enumerator.MoveNext()) { Quest.QuestInfo questInfo = _LowDataMgr.instance.GetLowDataQuestData(enumerator.Current.Value.unTaskId); if (questInfo.type != 2) { continue; } SubQuestList.Add(enumerator.Current.Value); } DetailRewardPos[0] = MainDetailPop.transform.FindChild("Reward/gold").localPosition; DetailRewardPos[1] = MainDetailPop.transform.FindChild("Reward/power").localPosition; DetailRewardPos[2] = MainDetailPop.transform.FindChild("Reward/exp").localPosition; // 보상은 항상 있는게 아니기때문에 위치값을 저장해줘서 정렬해줌 RewardPos[0] = CurMainQuestInfo.transform.FindChild("Reward/item").localPosition; RewardPos[1] = CurMainQuestInfo.transform.FindChild("Reward/gold").localPosition; RewardPos[2] = CurMainQuestInfo.transform.FindChild("Reward/exp").localPosition; //UIEventTrigger goldEtri = CurMainQuestInfo.transform.FindChild("Reward/gold").GetComponent<UIEventTrigger>(); //EventDelegate.Set(goldEtri.onClick, delegate () //{ //UIMgr.OpenClickPopup(599000, CurMainQuestInfo.transform.FindChild("Reward/gold").transform.position); //}); int subCount = SubQuestList.Count;//서브 셋팅 for (int i = 0; i < subCount; i++) { Transform tf = Instantiate(GridTf[0].GetChild(0)) as Transform; tf.parent = GridTf[0]; tf.localPosition = Vector3.zero; tf.localScale = Vector3.one; SetMainItem(tf, SubQuestList[i]); QuestInfo info = SubQuestList[i]; EventDelegate.Set(tf.GetComponent <UIEventTrigger>().onClick, delegate() { //SetMainDetailPopup(info); }); } QuestInfo curQuestInfo = QuestManager.instance.GetCurrentQuestInfo(); if (curQuestInfo != null) { GridTf[0].gameObject.SetActive(true); SetMainItem(CurMainQuestInfo.transform, curQuestInfo);//메인 셋팅 //EventDelegate.Set(GridTf[0].GetChild(0).GetComponent<UIEventTrigger>().onClick, delegate () { // SetMainDetailPopup(curQuestInfo); //}); GridTf[0].GetComponent <UIGrid>().repositionNow = true; CurMainQuestInfo.SetActive(true); } else { StartCoroutine("DelayCurMainQuest"); CurMainQuestInfo.SetActive(false); } GridTf[1].gameObject.SetActive(false); //메인퀘스트 상세 팝업 UIEventTrigger uiTriDetailClose = MainDetailPop.transform.FindChild("BtnClose").GetComponent <UIEventTrigger>(); UIEventTrigger uiTriDetailFog = MainDetailPop.transform.FindChild("fog").GetComponent <UIEventTrigger>(); EventDelegate.Set(uiTriDetailClose.onClick, delegate() { MainDetailPop.SetActive(false); }); EventDelegate.Set(uiTriDetailFog.onClick, delegate() { MainDetailPop.SetActive(false); }); GameObject slotGo = UIHelper.CreateInvenSlot(MainDetailPop.transform.FindChild("Reward/item")); DetailItemSlot = slotGo.GetComponent <InvenItemSlotObject>(); MainDetailPop.SetActive(false); OnClickTab(0); }
void OnClickRaid(bool isMulty, int groupId) { ViewObjs[0].SetActive(false); ViewObjs[1].SetActive(true); ViewObjs[2].SetActive(false); CurGameMode = isMulty ? GAME_MODE.MULTI_RAID : GAME_MODE.RAID; CurSubMode = groupId; uint bossIdx = 0; List <string> rewardList = null; List <string> itemList = null; if (!isMulty) { List <DungeonTable.SingleBossRaidInfo> raidLowList = _LowDataMgr.instance.GetLowDataBossRaidList(); int count = raidLowList.Count; for (int i = 0; i < count; i++) { DungeonTable.SingleBossRaidInfo raidLow = raidLowList[i]; if (raidLow.Type != groupId || raidLow.level != CurLevelDifficulty) { continue; } rewardList = raidLowList[i].RewardId.list; bossIdx = raidLowList[i].BossIdx; itemList = raidLowList[i].ItemId.list; RaidDesc.text = _LowDataMgr.instance.GetStringStageData(raidLowList[i].stageDesc); break; } } else { List <DungeonTable.MultyBossRaidInfo> raidLowList = _LowDataMgr.instance.GetLowDataMultyBossInfoList((byte)groupId); int count = raidLowList.Count; for (int i = 0; i < count; i++) { DungeonTable.MultyBossRaidInfo raidLow = raidLowList[i]; if (raidLow.level != CurLevelDifficulty) { continue; } rewardList = raidLowList[i].RewardId.list; bossIdx = raidLow.BossIdx; itemList = raidLow.ItemId.list; RaidDesc.text = _LowDataMgr.instance.GetStringStageData(raidLow.stageDesc); break; } } if (bossIdx <= 0) { Debug.LogError("not found boss Index Error " + CurSubMode); return; } UIHelper.CreateMonsterUIModel(RotationTargetList[0].transform, bossIdx, false, false, true, "DungeonPanel"); //드랍 아이템 셋 //드랍아이템은 나의 클래스에맞춰서 표시해준다 //장비아이템의경우 가장 등급이 높은것으로 int myClass = UIHelper.GetClassType(NetData.instance.GetUserInfo().GetCharIdx()); _LowDataMgr lowMgr = _LowDataMgr.instance; int dropIconCount = RaidDropItem.Length; for (int i = 0; i < dropIconCount; i++) { if (rewardList.Count <= i) { RaidDropItem[i].gameObject.SetActive(false); continue; } //uint rewardItemId = uint.Parse(rewardList[i]); uint itemId = uint.Parse(itemList[i]); RaidDropItem[i].gameObject.SetActive(true); InvenItemSlotObject slot = RaidDropItem[i].GetChild(0).GetComponent <InvenItemSlotObject>(); slot.SetLowDataItemSlot(itemId, 0, delegate(ulong key) { //UIMgr.OpenClickPopup(itemId, slot.transform.position); UIMgr.OpenDetailPopup(this, itemId); }); } RaidDropItem[0].parent.GetComponent <UIGrid>().Reposition(); UIScrollView scroll = RaidDropItem[0].parent.parent.GetComponent <UIScrollView>(); if (scroll != null) { scroll.ResetPosition(); scroll.enabled = rewardList.Count <= 5 ? false : true; } }
/// <summary> /// 장비강화재료 / 스킬강화재료 던전 /// </summary> void OnClickEquipAndSkillDungeon(bool isEquip) { _LowDataMgr lowMgr = _LowDataMgr.instance; ViewObjs[0].SetActive(false); ViewObjs[1].SetActive(false); ViewObjs[2].SetActive(true); EquipLvGroup.transform.gameObject.SetActive(isEquip); SkillLvGroup.transform.gameObject.SetActive(!isEquip); byte useEnergy = 0; List <string> itemList = null; if (isEquip) { //장비강화 DungeonTable.EquipInfo equipDungeonInfo = lowMgr.GetLowDataEquipBattle((byte)MaterialDungeonLevelDifficulty); if (equipDungeonInfo != null) { itemList = equipDungeonInfo.RewardItemId.list; useEnergy = equipDungeonInfo.UseEnergy; } } else { //스킬강화 DungeonTable.SkillInfo skillDungeonInfo = lowMgr.GetLowDataSkillBattle((byte)MaterialDungeonLevelDifficulty); if (skillDungeonInfo != null) { itemList = skillDungeonInfo.RewardItemId.list; useEnergy = skillDungeonInfo.UseEnergy; } } bool canGo = NetData.instance.GetAsset(AssetType.Energy) >= useEnergy; MaterialDungeonStartBtn.transform.FindChild("Txt_num").GetComponent <UILabel>().text = useEnergy.ToString(); MaterialDungeonStartBtn.transform.FindChild("Btn_on").gameObject.SetActive(canGo); MaterialDungeonStartBtn.transform.FindChild("Btn_off").gameObject.SetActive(!canGo); //드랍아이템 int dropIconCount = MaterialDungetnDropItem.Length; for (int i = 0; i < dropIconCount; i++) { if (itemList.Count <= i) { MaterialDungetnDropItem[i].gameObject.SetActive(false); continue; } uint itemId = uint.Parse(itemList[i]); MaterialDungetnDropItem[i].gameObject.SetActive(true); InvenItemSlotObject slot = MaterialDungetnDropItem[i].GetChild(0).GetComponent <InvenItemSlotObject>(); slot.SetLowDataItemSlot(itemId, 0, delegate(ulong key) { UIMgr.OpenDetailPopup(this, itemId); }); } MaterialDungetnDropItem[0].parent.GetComponent <UIGrid>().Reposition(); UIScrollView scroll = MaterialDungetnDropItem[0].parent.parent.GetComponent <UIScrollView>(); if (scroll != null) { scroll.ResetPosition(); scroll.enabled = itemList.Count <= 5 ? false : true; } EventDelegate.Set(MaterialDungeonStartBtn.onClick, delegate() { if (!canGo) { SceneManager.instance.SetNoticePanel(NoticeType.Message, 390); //체력부족? return; } //여기서 시작해줌 if (CurGameMode == GAME_MODE.SPECIAL_GOLD) { //uint level = NetData.instance.UserLevel; //byte dungeonId = 1; //while (true) //{ // DungeonTable.EquipInfo materialData = _LowDataMgr.instance.GetLowDataEquipBattle(dungeonId); // if (materialData != null) // { // if (materialData.MinenterLv < level) // break; // } // ++dungeonId; //} byte dungeonId = 1; DungeonTable.EquipInfo materialData = lowMgr.GetLowDataEquipBattle((byte)MaterialDungeonLevelDifficulty); if (materialData != null) { dungeonId = materialData.Index; } if (dungeonId == 0)//혹시 모를 경우를 대비해 이렇게 막아놓는다. { DungeonTable.EquipInfo mData = lowMgr.GetLowDataEquipBattle(1); string msg = _LowDataMgr.instance.GetStringCommon(699); msg = string.Format(msg, mData.MinenterLv); SceneManager.instance.SetNoticePanel(NoticeType.Message, 0, msg); return; } OnGoldGameStart(dungeonId); //NetworkClient.instance.SendPMsgCoinBattleStartC(dungeonId); } else if (CurGameMode == GAME_MODE.SPECIAL_EXP)//경험치 스테이지로 들어감 { //uint level = NetData.instance.UserLevel; //byte dungeonId = 1; //while (true) //{ // DungeonTable.SkillInfo skillData = _LowDataMgr.instance.GetLowDataSkillBattle(dungeonId); // if (skillData != null) // { // if (skillData.MinenterLv <= level) // break; // } // ++dungeonId; //} byte dungeonId = 1; DungeonTable.SkillInfo materialData = lowMgr.GetLowDataSkillBattle((byte)MaterialDungeonLevelDifficulty); if (materialData != null) { dungeonId = materialData.Index; } if (dungeonId == 0)//혹시 모를 경우를 대비해 이렇게 막아놓는다. { DungeonTable.SkillInfo skillData = lowMgr.GetLowDataSkillBattle(1); string msg = _LowDataMgr.instance.GetStringCommon(699); msg = string.Format(msg, skillData.MinenterLv); SceneManager.instance.SetNoticePanel(NoticeType.Message, 0, msg); return; } OnExpGameStart(dungeonId); //NetworkClient.instance.SendPMsgExpBattleStartC(dungeonId); } }); }
public override void Init() { base.Init(); Animation a = CreateBox(true, true, false); Animation b = CreateBox(false, true, false); TempCoroutine.instance.FrameDelay(0.1f, () => { Destroy(a.transform.parent.gameObject); Destroy(b.transform.parent.gameObject); }); TimeStr = _LowDataMgr.instance.GetStringCommon(524); EventDelegate.Set(InfoBtn.onClick, SetRateView); Transform goldTf = transform.FindChild("GachaView/List/Gold/Scroll/Grid"); Transform cashTf = transform.FindChild("GachaView/List/Cash/Scroll/Grid"); //0은 1회(공짜) 1은 10회(유료) SetBox(goldTf.GetChild(1), false, true); //골드 SetBox(cashTf.GetChild(1), false, false); //캐쉬 int length = ResultCards.Length; for (int i = 0; i < length; i++) { Transform tf = ResultCards[i]; if (tf == null) { Debug.LogError("is null error child number " + i); continue; } //tf.rotation = new Quaternion(0, 0, 0, 0);//원상 복구 tf.collider.enabled = true; GameObject goSlot = UIHelper.CreateInvenSlot(tf.FindChild("ItemRoot")); goSlot.name = "slot"; goSlot.SetActive(false); UIHelper.CreateEffectInGame(tf.FindChild("eff"), "Fx_UI_gacha_card_01", true); UIHelper.CreateEffectInGame(tf.FindChild("eff"), "Fx_UI_gacha_cardTrail_01", true); EventDelegate.Set(tf.GetComponent <UIEventTrigger>().onClick, delegate() { //단독 클릭시. int length2 = ResultCards.Length, count = 0; for (int j = 0; j < length2; j++) //검사용 해당 객체가 마지막인지 확인 { Transform tf2 = ResultCards[j]; if (tf2 == null) { Debug.LogError("is null error child number " + j); continue; } if (tf2.eulerAngles.y == 0) { ++count; } } tf.collider.enabled = false; TweenRotation.Begin(tf.gameObject, CardDuration, new Quaternion(0, -180, 0, 0)); SoundManager.instance.PlaySfxSound(IsGoldGacha ? eUISfx.UI_gatcha_normal_open : eUISfx.UI_gatcha_rare_open, false); TempCoroutine.instance.FrameDelay(CardDuration - CardOpenDelay, delegate() { if (tf.GetComponent <TweenRotation>() != null) { Destroy(tf.GetComponent <TweenRotation>(), CardDuration - (CardDuration - CardOpenDelay)); } tf.GetComponent <UISprite>().spriteName = ChardBack; tf.FindChild("ItemRoot/slot").gameObject.SetActive(true); }); if (count == 1)//마지막으로 남은 녀석임. { BtnOpenAllCard.gameObject.SetActive(false); TempCoroutine.instance.FrameDelay(CardDuration, delegate() { BtnAgain.gameObject.SetActive(true);//공짜가 아닐 경우 BtnClose.gameObject.SetActive(true); }); } }); } GameObject invenSlot = UIHelper.CreateInvenSlot(ResultOneCard.FindChild("ItemRoot")); UIHelper.CreateEffectInGame(ResultOneCard, "Fx_UI_gacha_card_01", true); UIHelper.CreateEffectInGame(ResultOneCard, "Fx_UI_gacha_cardTrail_01", true); OneCardSlot = invenSlot.GetComponent <InvenItemSlotObject>(); invenSlot.SetActive(false); EventDelegate.Set(BtnClose.onClick, delegate() { //결과화면 닫기 버튼 ChangeView(true); }); EventDelegate.Set(BtnAgain.onClick, delegate() { //카드 한번 더 //if(PlayGachaAndSaveToDayCount(IsGoldGacha) ) int toDayCount = GetToDayCount(IsGoldGacha); if ((IsOnceGacha && toDayCount <= 0) || (!IsOnceGacha && toDayCount != 10)) //일일 제한 횟수 에러 { SceneManager.instance.SetNoticePanel(NoticeType.Message, 377); } else { BtnOpenResult(IsOnceGacha, IsGoldGacha); } }); EventDelegate.Set(ResultOneCard.GetComponent <UIEventTrigger>().onClick, delegate() {//하나짜리 카드 뽑음 ResultOneCard.collider.enabled = false; SoundManager.instance.PlaySfxSound(IsGoldGacha ? eUISfx.UI_gatcha_normal_open : eUISfx.UI_gatcha_rare_open, false); TweenRotation.Begin(ResultOneCard.gameObject, CardDuration, new Quaternion(0, -180, 0, 0)); TempCoroutine.instance.FrameDelay(CardDuration - CardOpenDelay, delegate() { if (ResultOneCard.GetComponent <TweenRotation>() != null) { Destroy(ResultOneCard.GetComponent <TweenRotation>(), CardDuration - (CardDuration - CardOpenDelay)); } ResultOneCard.GetComponent <UISprite>().spriteName = ChardBack; OneCardSlot.gameObject.SetActive(true); }); TempCoroutine.instance.FrameDelay(CardDuration, delegate() { BtnAgain.gameObject.SetActive(true); BtnClose.gameObject.SetActive(true); }); }); EventDelegate.Set(BtnOpenAllCard.onClick, delegate() {//한번에 열기 //BtnOpenCard.gameObject.SetActive(false); BtnOpenAllCard.gameObject.SetActive(false); int cardLength = ResultCards.Length; for (int i = 0; i < cardLength; i++) { Transform tf = ResultCards[i]; if (tf == null) { Debug.LogError("is null error child number " + i); continue; } if (tf.eulerAngles.y != 0)//이미 돌아간 녀석 { continue; } tf.collider.enabled = false; TweenRotation.Begin(tf.gameObject, CardDuration, new Quaternion(0, -180, 0, 0)); TempCoroutine.instance.FrameDelay(CardDuration - CardOpenDelay, delegate() { if (tf.GetComponent <TweenRotation>() != null) { Destroy(tf.GetComponent <TweenRotation>(), CardDuration - (CardDuration - CardOpenDelay)); } tf.GetComponent <UISprite>().spriteName = ChardBack; tf.FindChild("ItemRoot/slot").gameObject.SetActive(true); }); } SoundManager.instance.PlaySfxSound(IsGoldGacha ? eUISfx.UI_gatcha_normal_open : eUISfx.UI_gatcha_rare_open, false); TempCoroutine.instance.FrameDelay(CardDuration, delegate() { BtnAgain.gameObject.SetActive(true); BtnClose.gameObject.SetActive(true); }); }); EventDelegate.Set(Popup.transform.FindChild("BtnOk").GetComponent <UIEventTrigger>().onClick, delegate() { Popup.SetActive(false); }); ResultAlpha.enabled = false; ResultAlpha.gameObject.SetActive(true); AniObj.SetActive(false); Popup.SetActive(false); RateView.SetActive(false); GachaView.SetActive(true); ChangeView(true);//리스트 뷰로 시작 PanhoLbls[0].text = string.Format(_LowDataMgr.instance.GetStringCommon(946), GetToDayCount(true)); PanhoLbls[1].text = string.Format(_LowDataMgr.instance.GetStringCommon(946), GetToDayCount(false)); }
/// <summary> 10회 뽑기 </summary> public void OnTen(bool isSenior, NetData.DropItemData[] itemArr) { //reduceGachaOppotunity (!isSenior, 10); // refresh Transform goldTf = transform.FindChild("GachaView/List/Gold/Scroll/Grid"); Transform cashTf = transform.FindChild("GachaView/List/Cash/Scroll/Grid"); SetBox(goldTf.GetChild(0), true, true); //골드 SetBox(goldTf.GetChild(1), false, true); //골드 SetBox(cashTf.GetChild(0), true, false); //캐쉬 SetBox(cashTf.GetChild(1), false, false); //캐쉬 ///////// ResultCards[0].parent.gameObject.SetActive(false); ResultOneCard.gameObject.SetActive(false); ResultText.SetActive(false); AniObj.SetActive(true); Animation ani = CreateBox(isSenior, false, true); ani.Play(isSenior ? "box_gold_01" : "box_wood_01"); int length = ResultCards.Length; for (int i = 0; i < length; i++) { Transform tf = ResultCards[i]; if (tf == null) { Debug.LogError("is null error child number " + i); continue; } else if (itemArr.Length <= i) { continue; } tf.rotation = new Quaternion(0, 0, 0, 0);//원상 복구 tf.collider.enabled = false; tf.GetComponent <UISprite>().spriteName = ChardForward; InvenItemSlotObject slot = tf.FindChild("ItemRoot/slot").GetComponent <InvenItemSlotObject>(); slot.SetLowDataItemSlot(itemArr[i].LowDataId, itemArr[i].Amount); tf.FindChild("ItemRoot/slot").gameObject.SetActive(false); int idx = i; EventDelegate.Set(tf.FindChild("ItemRoot").transform.GetComponent <UIEventTrigger>().onClick, delegate() { uint itemidx = itemArr[idx].LowDataId; if (itemArr[idx].LowDataId == 1) { itemidx = 599000; } else if (itemArr[idx].LowDataId == 2 || itemArr[idx].LowDataId == 8) { itemidx = 599001; } else if (itemArr[idx].LowDataId == 5) { itemidx = 599002; } else { itemidx = itemArr[idx].LowDataId; } OnclicItemPopup(itemidx); }); } StartCoroutine("CardAction", false); IsGoldGacha = !isSenior; IsOnceGacha = false; SaveToDayCount(IsGoldGacha, 10); //BtnOpenCard.gameObject.SetActive(false); BtnOpenAllCard.gameObject.SetActive(false); BtnAgain.gameObject.SetActive(false); BtnClose.gameObject.SetActive(false); ChangeView(false); }
private int CurrentLowDataArr; //데이터 배열값 현재 선택된 층수의 배열값임 public override void Init() { base.Init(); //랭킹 슬롯 생성. for (int i = 1; i < SystemDefine.MaxTowerRanking; i++)//9개만 생성한다 { GameObject slotGo = Instantiate(RankingPrefab) as GameObject; Transform slotTf = slotGo.transform; slotTf.parent = RankGrid.transform; slotTf.localPosition = Vector3.zero; slotTf.localScale = Vector3.one; slotGo.SetActive(false); } Transform rewardTf = transform.FindChild("Info/Reward/Grid"); if (rewardTf != null) { for (int i = 0; i < 10; i++) { GameObject slotGo = UIHelper.CreateInvenSlot(rewardTf); InvenItemSlotObject invenSlot = slotGo.GetComponent <InvenItemSlotObject>(); invenSlot.SetBackGround("Bod_Inbod11"); invenSlot.EmptySlot(); InvenSlotList.Add(invenSlot); } } FirstRewardClear.SetActive(false); FloorGrid.parent.gameObject.SetActive(false); RankGrid.repositionNow = true; TowerLowDataList = _LowDataMgr.instance.GetLowDataTowerList(); FloorText = _LowDataMgr.instance.GetStringCommon(189); int floorCount = TowerLowDataList.Count; for (int i = 0; i < floorCount; i++) { GameObject go = Instantiate(FloorPrefab) as GameObject; Transform tf = go.transform; tf.parent = FloorGrid.transform; tf.localPosition = Vector3.zero; tf.localScale = Vector3.one; } GameObject firstGo = UIHelper.CreateInvenSlot(transform.FindChild("Info/FirstReward")); FirstReward = firstGo.GetComponent <InvenItemSlotObject>(); UIButton uiBtn = transform.FindChild("Info/BtnEntry").GetComponent <UIButton>(); EventDelegate.Set(uiBtn.onClick, OnClickEntry); //상점 바로가기 EventDelegate.Set(transform.FindChild("Info/BtnShop").GetComponent <UIButton>().onClick, OnclickShowShopPanel); SelectEff = UIHelper.CreateEffectInGame(transform, "Fx_UI_tower_position_01").transform; TempCoroutine.instance.FrameDelay(0.1f, () => { Material effM_1 = SelectEff.GetChild(0).FindChild("fix_circle_1").renderer.material; Material effM_2 = SelectEff.GetChild(0).FindChild("fix_circle_2").renderer.material; effM_1.SetColor("_TintColor", SelectColor[0]); effM_2.SetColor("_TintColor", SelectColor[1]); }); SelectEff.GetChild(0).FindChild("_particle_set").gameObject.SetActive(false); SelectEff.GetChild(0).FindChild("Ray_1").gameObject.SetActive(false); SelectEff.GetChild(0).FindChild("Ray_2").gameObject.SetActive(false); MinPosY = FloorScroll.transform.localPosition.y; }
/// <summary> 보상아이템 셋팅 </summary> void SettingRewardItem() { if (G_GameInfo.GameMode == GAME_MODE.ARENA) { RewardAssetTf.parent.gameObject.SetActive(false); return; } RewardAssetTf.parent.gameObject.SetActive(true); RewardAssetTf.gameObject.SetActive(false); RewardExp.gameObject.SetActive(false); RewardGold.gameObject.SetActive(false); uint firstRewardId = 0; uint fixedRewardId = 0; if (G_GameInfo.GameMode == GAME_MODE.SINGLE && isSuccess) { DungeonTable.StageInfo lowData = _LowDataMgr.instance.GetStageInfo(SingleGameState.lastSelectStageId); //최초보상이 있을씨에.. if (SingleGameState.IsFirstReward) { GatchaReward.FixedRewardInfo firstInfo = _LowDataMgr.instance.GetFixedRewardItem(lowData.FirstReward); GameObject go = Instantiate(ItemSlotPrefab) as GameObject; Transform tf = go.transform; tf.parent = RewardGrid.transform; tf.localPosition = Vector3.zero; tf.localScale = Vector3.one; InvenItemSlotObject firstSlotObj = go.GetComponent <InvenItemSlotObject>(); firstSlotObj.SetLowDataItemSlot(firstInfo.ItemId == 0 ? firstInfo.Type : firstInfo.ItemId, firstInfo.ItemCount); FirstRewardSlotLabel.transform.parent = go.transform; FirstRewardSlotLabel.transform.localPosition = new Vector3(0, 42, 0); FirstRewardSlotLabel.transform.localScale = Vector3.one; FirstRewardSlotLabel.SetActive(true); firstRewardId = firstInfo.ItemId == 0 ? firstInfo.Type : firstInfo.ItemId; } // 기본보상표시 0이면안준다 if (lowData.FixedReward != 0) { GatchaReward.FixedRewardInfo basicInfo = _LowDataMgr.instance.GetFixedRewardItem(lowData.FixedReward); GameObject basicGo = Instantiate(ItemSlotPrefab) as GameObject; Transform basicTf = basicGo.transform; basicTf.parent = RewardGrid.transform; basicTf.localPosition = Vector3.zero; basicTf.localScale = Vector3.one; InvenItemSlotObject basicSlotObj = basicGo.GetComponent <InvenItemSlotObject>(); basicSlotObj.SetLowDataItemSlot(basicInfo.ItemId == 0 ? basicInfo.Type : basicInfo.ItemId, basicInfo.ItemCount); BasicRewardSlotLabel.transform.parent = basicGo.transform; BasicRewardSlotLabel.transform.localPosition = new Vector3(0, 42, 0); BasicRewardSlotLabel.transform.localScale = Vector3.one; BasicRewardSlotLabel.SetActive(true); fixedRewardId = basicInfo.ItemId == 0 ? basicInfo.Type : basicInfo.ItemId; } } List <NetData.DropItemData> dropItemList = Reward.GetList; if (dropItemList != null) { int count = dropItemList.Count; for (int i = 0; i < count; i++) { NetData.DropItemData dropData = dropItemList[i]; //위에 표기됬으므로 표기안해줌 if (dropData.LowDataId == fixedRewardId) { continue; } if (dropData.LowDataId == firstRewardId) { continue; } GameObject go = Instantiate(ItemSlotPrefab) as GameObject; Transform tf = go.transform; tf.parent = RewardGrid.transform; tf.localPosition = Vector3.zero; tf.localScale = Vector3.one; InvenItemSlotObject slotObj = go.GetComponent <InvenItemSlotObject>(); slotObj.SetLowDataItemSlot(dropData.LowDataId, dropData.Amount); } RewardGrid.repositionNow = true; } if (5 < RewardGrid.transform.childCount) { RewardGrid.transform.parent.GetComponent <UIScrollView>().enabled = true; } else { RewardGrid.transform.parent.GetComponent <UIScrollView>().enabled = false; } if (G_GameInfo.GameMode == GAME_MODE.SINGLE)//GAME_MODE.SPECIAL) { return; } else { //획득 재화 설정 bool isGoldDungeon = false, isExpDungeon = false; if (G_GameInfo.GameMode == GAME_MODE.SPECIAL_EXP) { isExpDungeon = true; } else if (G_GameInfo.GameMode == GAME_MODE.SPECIAL_GOLD) { isGoldDungeon = true; } AssetType assetType = AssetType.None; if (G_GameInfo.GameMode == GAME_MODE.TOWER) { assetType = AssetType.Badge; } if (0 <= Reward.GetCoin && !isExpDungeon) { RewardGold.gameObject.SetActive(true); RewardGold.text = Reward.GetCoin == 0 ? "0" : Reward.GetCoin.ToString(); // ToString("#,##"); } if (0 <= Reward.GetExp && !isGoldDungeon) { RewardExp.gameObject.SetActive(true); RewardExp.text = Reward.GetExp == 0 ? "0" : Reward.GetExp.ToString(); // ToString("#,##"); } if (0 <= Reward.GetAsset && assetType != AssetType.None) { RewardAssetTf.gameObject.SetActive(true); RewardAssetTf.GetComponent <UILabel>().text = Reward.GetAsset == 0 ? "0" : Reward.GetAsset.ToString(); // ToString("#,##"); UISprite sp = RewardAssetTf.FindChild("icon").GetComponent <UISprite>(); switch (assetType) { case AssetType.Badge: sp.spriteName = "badge_A"; //Img_flag2 break; } } } }
/// <summary> 비동기 방식의 게임들 결과화면 </summary> void ResultDungeon() { if (G_GameInfo.GameMode == GAME_MODE.SINGLE) { //현재 최초보상받을수있는지 체크? DungeonTable.StageInfo lowData = _LowDataMgr.instance.GetStageInfo(SingleGameState.lastSelectStageId); if (lowData != null) { //if (lowData.type == 2 && isSuccess) // { if (SingleGameState.IsFirstReward) { GatchaReward.FixedRewardInfo firstInfo = _LowDataMgr.instance.GetFixedRewardItem(lowData.FirstReward); //최초보상받을시기? GameObject go = Instantiate(ItemSlotPrefab) as GameObject; Transform tf = go.transform; tf.parent = FirstRewardPopup.transform.FindChild("Icon").transform; tf.localPosition = Vector3.zero; tf.localScale = Vector3.one; UILabel name = FirstRewardPopup.transform.FindChild("Txt_Iconname").GetComponent <UILabel>(); InvenItemSlotObject slotObj = go.GetComponent <InvenItemSlotObject>(); slotObj.SetLowDataItemSlot(firstInfo.ItemId == 0? firstInfo.Type : firstInfo.ItemId, firstInfo.ItemCount); Item.EquipmentInfo equipInfo = _LowDataMgr.instance.GetLowDataEquipItemInfo(firstInfo.ItemId); if (equipInfo != null) //장비 { name.text = _LowDataMgr.instance.GetStringItem(equipInfo.NameId); } else { uint id = 0; //혹시 재화인가.... if (firstInfo.ItemId == 0) { switch (firstInfo.Type) { case 1: //골드 id = 599000; break; case 2: //원보 id = 599001; break; case 3: //공헌 id = 599004; break; case 4: //명예 id = 599005; break; case 5: //휘장 id = 599002; break; case 6: //사자왕 id = 599006; break; case 7: //성망 id = 599003; break; case 8: //체력 id = 599104; break; case 9: //경험치; id = 599105; break; } name.text = _LowDataMgr.instance.GetStringItem(_LowDataMgr.instance.GetUseItem(firstInfo.ItemId == 0 ? id : firstInfo.ItemId).NameId); } else { name.text = _LowDataMgr.instance.GetStringItem(_LowDataMgr.instance.GetUseItem(firstInfo.ItemId).NameId); } } SetRenderQueue renderQ = UIHelper.FindComponent <SetRenderQueue>(FirstRewardPopup.transform.FindChild("Effect")); if (renderQ != null) { renderQ.ResetRenderQ(3031); } FirstRewardPopup.SetActive(true); TempCoroutine.instance.FrameDelay(0.1f, () => { FirstRewardPopup.transform.GetComponent <TweenScale>().ResetToBeginning(); FirstRewardPopup.transform.GetComponent <TweenScale>().PlayForward(); }); TempCoroutine.instance.FrameDelay(3f, () => { FirstRewardPopup.SetActive(false); }); } } // } if (isSuccess && SceneManager.instance.CurTutorial == TutorialType.STAGE)//튜토리얼 중 스테이지 클리어했다면 { SceneManager.instance.CurTutorial = TutorialType.STAGE; } } Reward = NetData.instance._RewardData; if (Reward == null)//없으면 안돼겠지만. 뻑은 안나게.. { Reward = new NetData.RewardData(); } uint curExp = 0, maxExp = 0, level = 0; if (Reward.GetExp <= 0)//획득 경험치가 있다면 뭔가 데이터가 있다는 것임. { level = NetData.instance.UserLevel; NetData.instance.GetUserInfo().GetCurrentAndMaxExp(ref curExp, ref maxExp); } else { curExp = Reward.SaveExp; maxExp = Reward.SaveMaxExp; level = Reward.SaveLevel; } ExpGauge.value = (float)curExp / (float)maxExp; Labels[(int)labelT.hLv].text = string.Format(_LowDataMgr.instance.GetStringCommon(453), level); SettingRewardItem(); if (G_GameInfo.GameMode == GAME_MODE.SINGLE)//싱글게임에만 스테이지 퀘스트가 존재. { StartCoroutine("MissionResult"); } else if (G_GameInfo.GameMode != GAME_MODE.ARENA) { Result(); } if (isSuccess) { TitleObj[0].SetActive(true); UIHelper.CreateEffectInGame(TitleObj[0].transform.FindChild("bg"), "Fx_UI_exp_result_01"); } else { TitleObj[1].SetActive(true); } }
public override void LateInit() { base.LateInit(); //파라메터로 넘어오는 데이터 세팅 isSuccess = (bool)parameters[0]; GAME_MODE gameMode = G_GameInfo.GameMode; if (gameMode == GAME_MODE.SINGLE && (G_GameInfo.GameInfo as SingleGameInfo).IsQuestClear)//이 경우 마을가기만 존재함 { Btns[(int)btnT.nextZone].gameObject.SetActive(false); Btns[(int)btnT.goStageBtn].gameObject.SetActive(false); Btns[(int)btnT.goTownBtn].gameObject.SetActive(false); Btns[(int)btnT.clearQuest].gameObject.SetActive(true); EventDelegate.Set(Btns[(int)btnT.clearQuest].onClick, delegate() { GotoTown(null); }); } else//게임모드에 따라서 버튼 추가 { if (gameMode == GAME_MODE.SINGLE || gameMode == GAME_MODE.TOWER) { Btns[(int)btnT.nextZone].gameObject.SetActive(isSuccess); //승리했을때만 다음스테이지가 나와야한다? } else { Btns[(int)btnT.nextZone].gameObject.SetActive(false); } uint key = 0; if (gameMode == GAME_MODE.TOWER) { key = 540; } else { key = 531; } Btns[(int)btnT.nextZone].transform.FindChild("label").GetComponent <UILabel>().text = _LowDataMgr.instance.GetStringCommon(key); Btns[(int)btnT.clearQuest].gameObject.SetActive(false); } RewardAssetTf.parent.gameObject.SetActive(false); ResultDungeon(); if (gameMode == GAME_MODE.ARENA)//등급 상승 or 하락 연출 { //성망획득량.. 승/패와관려없이 나옴 GameObject go = Instantiate(ItemSlotPrefab) as GameObject; Transform tf = go.transform; tf.parent = ArenaView.FindChild("RankInfo/item").transform; tf.localPosition = Vector3.zero; tf.localScale = Vector3.one; InvenItemSlotObject slotObj = go.GetComponent <InvenItemSlotObject>(); slotObj.SetLowDataItemSlot(599003, (uint)parameters[1]); ArenaView.FindChild("RankPop/BeforeNum").GetComponent <UILabel>().text = string.Format("{0}", ArenaGameState.MyRank - ArenaGameState.TargetRank); ArenaView.FindChild("RankPop/AfterNum-").GetComponent <UILabel>().text = string.Format(_LowDataMgr.instance.GetStringCommon(1267), (ArenaGameState.MyTopRank - ArenaGameState.TargetRank) * _LowDataMgr.instance.GetEtcTableValue <uint>(EtcID.PvPfirstgetcash)); StartCoroutine("TextAction", new object[] { ArenaGameState.MyRank, ArenaGameState.TargetRank, _LowDataMgr.instance.GetStringCommon(521), ArenaView.FindChild("RankPop/AfterNum").GetComponent <UILabel>() }); if (isSuccess && ArenaGameState.TargetRank < ArenaGameState.MyTopRank)//등급 상승 { ArenaView.FindChild("RankPop/BeforeNum").GetComponent <UILabel>().text = string.Format("{0}", ArenaGameState.MyRank - ArenaGameState.TargetRank); ArenaView.FindChild("RankPop/AfterNum-").GetComponent <UILabel>().text = string.Format(_LowDataMgr.instance.GetStringCommon(1267), (ArenaGameState.MyTopRank - ArenaGameState.TargetRank) * _LowDataMgr.instance.GetEtcTableValue <uint>(EtcID.PvPfirstgetcash)); StartCoroutine("TextAction", new object[] { ArenaGameState.MyRank, ArenaGameState.TargetRank, _LowDataMgr.instance.GetStringCommon(521), ArenaView.FindChild("RankPop/AfterNum").GetComponent <UILabel>() }); //최고랭킹달성원보 GameObject gem = Instantiate(ItemSlotPrefab) as GameObject; Transform gemTf = gem.transform; gemTf.parent = ArenaView.FindChild("RankInfo/gem").transform; gemTf.localPosition = Vector3.zero; gemTf.localScale = Vector3.one; InvenItemSlotObject gemObj = gem.GetComponent <InvenItemSlotObject>(); gemObj.SetLowDataItemSlot(599001, (uint)parameters[2]); EventDelegate.Set(ArenaView.FindChild("RankPop/BtnClose").GetComponent <UIEventTrigger>().onClick, () => { if (ArenaView.FindChild("RankPop/bg").transform.childCount > 0) { DestroyImmediate(ArenaView.FindChild("RankPop/bg").transform.GetChild(0).gameObject); } ArenaView.FindChild("RankPop").gameObject.SetActive(false); ArenaResult(); //이때켜준다 ArenaView.FindChild("RankInfo").gameObject.SetActive(true); transform.FindChild("Normal").gameObject.SetActive(true); }); ArenaView.FindChild("RankPop").gameObject.SetActive(true); ArenaView.FindChild("RankInfo").gameObject.SetActive(false); transform.FindChild("Normal").gameObject.SetActive(false); //이펙트 UIHelper.CreateEffectInGame(ArenaView.FindChild("RankPop/title").transform, "Fx_UI_result_01"); TempCoroutine.instance.FrameDelay(1.5f, () => { UIHelper.CreateEffectInGame(ArenaView.FindChild("RankPop/bg").transform, "Fx_UI_result_02"); }); } else { ArenaView.FindChild("RankPop").gameObject.SetActive(false); ArenaView.FindChild("RankInfo").gameObject.SetActive(true); transform.FindChild("Normal").gameObject.SetActive(true); ArenaResult(); } ArenaView.gameObject.SetActive(true); } if (SceneManager.instance.testData.bSingleSceneTestStart) { TempCoroutine.instance.FrameDelay(2f, () => { GotoTown(null); }); } if (SceneManager.instance.testData.bQuestTestStart) { TempCoroutine.instance.FrameDelay(2f, () => { GotoTown(null); }); } }
/// <summary> 메일 아이템 획득 연출 </summary> void UpdateGetMailItem() { for (int j = 0; j < GetMailSlotTf.Length; j++) { Transform tf = GetMailSlotTf[j]; TweenAlpha alpha = tf.GetComponent <TweenAlpha>(); if (0 < alpha.value)//아직 사용중. { continue; } NetData.EmailAttachmentInfo mailInfo = GetItemList[0]; GetItemList.RemoveAt(0); tf.GetComponent <UIWidget>().enabled = true; UILabel amount = tf.FindChild("amount").GetComponent <UILabel>(); Transform normalTf = tf.FindChild("normal"); InvenItemSlotObject invenSlot = tf.FindChild("root").GetChild(0).GetComponent <InvenItemSlotObject>(); Vector3 pos = tf.localPosition; pos.y = j * 55; tf.localPosition = pos; //if (mailInfo.GoodType == (int)AssetType.None || mailInfo.GoodType == (int)AssetType.Everything)//소비, 장비 if (50 < mailInfo.Id) { normalTf.gameObject.SetActive(false); invenSlot.gameObject.SetActive(true); invenSlot.SetLowDataItemSlot(mailInfo.Id == 0 ? mailInfo.GoodType : mailInfo.Id, mailInfo.Count); } else { normalTf.gameObject.SetActive(true); invenSlot.gameObject.SetActive(false); switch ((AssetType)mailInfo.GoodType) { case AssetType.Exp: normalTf.FindChild("sprite").gameObject.SetActive(false); normalTf.FindChild("exp").gameObject.SetActive(true); break; default: normalTf.FindChild("sprite").gameObject.SetActive(true); normalTf.FindChild("exp").gameObject.SetActive(false); UISprite sp = normalTf.FindChild("sprite").GetComponent <UISprite>(); if (mailInfo.GoodType == (int)AssetType.Energy) { sp.spriteName = "stamina"; } else if (mailInfo.GoodType == (int)AssetType.Gold) { sp.spriteName = "money"; } else if (mailInfo.GoodType == (int)AssetType.Cash) { sp.spriteName = "cash"; } break; } } amount.text = string.Format("{0}", mailInfo.Count); alpha.ResetToBeginning(); alpha.PlayForward(); break; } if (GetItemList.Count <= 0) { TweenAlpha mailAlpha = GetMailSlotTf[0].GetComponent <TweenAlpha>(); TempCoroutine.instance.KeyDelay("GetMailItem", mailAlpha.delay + mailAlpha.duration, () => { NoticeGo[(int)NoticeType.GetMailItem].SetActive(false); }); } }