123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- using FairyGUI;
- using UI.DressUp;
- using UI.Main;
- using System.Collections.Generic;
- using UnityEngine;
- using UI.ClothingSynthetic;
- namespace GFGGame
- {
- public class GuideController
- {
- /*******************************************************单人战斗引导***********************************************/
- public static void TryGuideChapterViewLevelItem(GObject target, string guideStr = null)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
- {
- if (guideStr == null)
- {
- UI_CompStoryLevelItem levelItem = UI_CompStoryLevelItem.Proxy(target);
- if (levelItem != null)
- {
- int level = int.Parse(levelItem.target.name.Replace("g", ""));
- string levelID = StoryDataManager.currentChapter + "_" + level;
- StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
- if (storyLevelCfg.fightID != null && storyLevelCfg.fightID.Length > 0)
- {
- guideStr = "遇到意外事件了,暂时解释不清,先按请求换上服饰吧";
- }
- else
- {
- guideStr = "点击关卡图标,继续故事";
- }
- }
- else
- {
- guideStr = "点击,继续";
- }
- }
- GuideDataManager.currentGuideId = ConstGuideId.SINGLE_FIGHT_GUIDE;
- ShowGuide(target, true, guideStr);
- }
- else if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
- {
- }
- }
- public static void TryGuideChapterInfoViewBtnStart(GObject target, string guideStr = null)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
- {
- if (guideStr == null)
- {
- guideStr = "点击,继续";
- }
- ShowGuide(target, true, guideStr);
- }
- }
- public static bool TryGuideDressUpFightViewMenuType0(GList list)
- {
- if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel <= 2
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- int len = list.numChildren;
- for (int i = 0; i < len; i++)
- {
- UI_TypeItem item = UI_TypeItem.Proxy(list.GetChildAt(i));
- if (item != null)
- {
- int menuID = (int)item.target.data;
- DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
- if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
- {
- ShowGuide(item.target, true, "点击相应的分类,可以快速找到服饰");
- return true;
- }
- }
- }
- }
- return false;
- }
- public static void TryGuideDressUpFightViewMenuPart0(GList list, string guideStr)
- {
- if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel <= 2
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- if (list.numChildren > 0)
- {
- UI_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, true, guideStr);
- return;
- }
- }
- }
- }
- public static void TryGuideDressUpFightViewBtnNext0(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SINGLE_FIGHT_GUIDE) <= 0)
- {
- ShowGuide(target, false, "接下来验证一下,换上的服饰是否符合需求");
- }
- }
- public static void TryGuideSingleScoreViewComClickCircle(GObject target)
- {
- ShowGuide(target, false, "服饰比较繁琐,适当的整理会更加分,点击为各部位修整吧");
- }
- /*******************************************************引导购买必需品***********************************************/
- public static void TryGuideDressUpFightViewBtnRecommend(GObject target, GList list)
- {
- _list = list;
- if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
- && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
- && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
- {
- GuideDataManager.currentGuideId = ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY;
- ShowGuide(target, false, "当提示有“必需品”时,需要穿上对应物品才能通关");
- }
- }
- public static void TryGuideApproachOfItemViewList(GList list)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
- && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
- && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
- {
- UI.CommonGame.UI_ApproachOfItemUI listItem = UI.CommonGame.UI_ApproachOfItemUI.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, false, "该物品可以在服装店购买,点开服装店看看");
- }
- }
- }
- public static void TryGuideBuyCountViewBtnSure(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
- && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- ShowGuide(target, false, "找到需要的物品了,点击购买吧");
- }
- }
- public static void TryGuideClothingShopViewBtnBack(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
- && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- ShowGuide(target, false, "点击返回,回到换装");
- }
- }
- private static GList _list;
- public static bool TryGuideDressUpFightViewMenuType1()
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
- && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- int len = _list.numChildren;
- for (int i = 0; i < len; i++)
- {
- UI_comListType item = UI_comListType.Proxy(_list.GetChildAt(i));
- if (item != null)
- {
- int menuID = (int)item.target.data;
- DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
- if (dressUpMenuItemCfg1.type == ConstDressUpItemType.LIAN_YI_QUN)
- {
- ShowGuide(item.target, true, "在相应分类里就可以找到必需品啦");
- _list = null;
- return true;
- }
- }
- }
- }
- return false;
- }
- public static void TryGuideDressUpFightViewMenuPart1(GList list, string guideStr)
- {
- if (StoryDataManager.currentChapter == 1 && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- if (list.numChildren > 0)
- {
- UI_PartsList listItem = UI_PartsList.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, true, guideStr);
- return;
- }
- }
- }
- }
- /***************************************************点击查看关卡提示***************************************************/
- public static void TryGuideDressUpFightViewBtnHint(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SEE_DRESS_TIPS) <= 0
- && StoryDataManager.currentLevel == 6
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- GuideDataManager.currentGuideId = ConstGuideId.SEE_DRESS_TIPS;
- ShowGuide(target, false, "这次换装需要获得别人的认可呢");
- }
- }
- /******************************************************双人对战评分************************************************/
- public static void TryGuideStoryFightTargetScoreComCircle(GObject target, float devWidth, float devHeight)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.TARGET_FIGHT_GUIDE) <= 0
- && StoryDataManager.currentLevel == 6
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- GuideDataManager.currentGuideId = ConstGuideId.TARGET_FIGHT_GUIDE;
- ShowGuide(target, false, "这里可以观察双方的分数计算", 0, false, devWidth, devHeight);
- }
- }
- public static void TryGuideStoryFightTargetScorebtnSkill0(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.TARGET_FIGHT_GUIDE) <= 0
- && StoryDataManager.currentLevel == 6
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel))
- {
- ShowGuide(target, false, "使用技能,可以增加胜出的几率哦,点击看看");
- }
- }
- /*******************************************************引导抽奖***********************************************/
- public static bool TryGuideGoBackStoryChapter(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
- && StoryDataManager.CheckLevelPass(1, 10)
- && !StoryDataManager.CheckLevelPass(1, 11))
- {
- GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
- ShowGuide(target, true, "点击返回主界面", 0);
- return true;
- }
- return false;
- }
- public static bool TryGuideLuckyBox(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
- && StoryDataManager.CheckLevelPass(1, 10)
- && !StoryDataManager.CheckLevelPass(1, 11))
- {
- GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
- ShowGuide(target, false, "“摘星”里可以通过星辰的力量获得服饰");
- return true;
- }
- return false;
- }
- public static bool TryGuideLuckyBoxStar()
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.MAIN_UI_BTN_ZHAI_XING) <= 0
- && StoryDataManager.CheckLevelPass(1, 10)
- && !StoryDataManager.CheckLevelPass(1, 11))
- {
- GuideDataManager.currentGuideId = ConstGuideId.MAIN_UI_BTN_ZHAI_XING;
- ShowGuide(null, false, "点击将星星链接在一起", 1400);
- return true;
- }
- return false;
- }
- /*****************************************************引导自由换装保存套装*************************************************/
- public static bool TryGuideDressUpViewMenuType1(GList list)
- {
- if (GuideDataManager.currentGuideId == ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG)
- {
- int len = list.numChildren;
- list.ScrollToView(len - 1);
- for (int i = 0; i < len; i++)
- {
- UI_comListType item = UI_comListType.Proxy(list.GetChildAt(i));
- if (item != null)
- {
- int menuID = (int)item.target.data;
- DressUpMenuItemCfg1 dressUpMenuItemCfg1 = DressUpMenuItemCfg1Array.Instance.GetCfg(menuID);
- if (dressUpMenuItemCfg1.type == ConstDressUpItemType.TAO_ZHUANG)
- {
- ShowGuide(item.target, true, "套装分类里,可以查看集齐成套的服饰");
- return true;
- }
- }
- }
- }
- return false;
- }
- public static void TryGuideDressUpViewMenuPart(GList list)
- {
- if (GuideDataManager.currentGuideId == ConstGuideId.MAIN_UI_BTN_HUAN_ZHUANG)
- {
- if (list.numChildren > 0)
- {
- UI_PartsList listItem = UI_PartsList.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, true, "点击一键换上");
- return;
- }
- }
- }
- }
- /************************************************************引导合成套装*******************************************************/
- public static void TryGuideStoryChapterView(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2)
- && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel <= 2)
- {
- GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
- ShowGuide(target, false, "点击进行下一关");
- }
- }
- public static void TryGuideStoryLevelInfoViewTxtNeed(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2)
- && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel <= 2)
- {
- GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
- ShowGuide(target, false, "这次必需品,要通过合成获得", 0, true);
- }
- }
- public static void TryGuideStoryLevelInfoView(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2)
- && GuideDataManager.currentGuideId == ConstGuideId.SUIT_SYNTHETIC_GUIDE)
- {
- ShowGuide(target, false, "点击空白处关闭", 1400);
- }
- }
- public static void TryGuideStoryChapterViewBtnHome(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- ShowGuide(target, false, "先回到主界面", 0);
- }
- }
- public static bool TryGuideMainUIViewBtnXiuFang(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2)
- // && GuideDataManager.currentGuideId == ConstGuideId.SUIT_SYNTHETIC_GUIDE
- )
- {
- GuideDataManager.currentGuideId = ConstGuideId.SUIT_SYNTHETIC_GUIDE;
- ShowGuide(target, false, "绣坊里增添了新功能", 0);
- return true;
- }
- return false;
- }
- public static void TryGuideSuitSyntheticView(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- ShowGuide(target, false, "这里可以查看已获得的服饰图谱", 0);
- }
- }
- public static void TryGuideSuitSyntheticViewList(GList list)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- if (list.numChildren > 0)
- {
- UI_SuitListItem listItem = UI_SuitListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, true, "查看已解锁的图谱");
- return;
- }
- }
- }
- }
- public static void TryGuideClothingSyntheticViewSuitList(GList list)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- if (list.numChildren > 0)
- {
- UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.m_loaderIcon, true, "找到需要合成的物品", 0, false);
- return;
- }
- }
- }
- }
- public static void TryGuideClothingSyntheticViewList(GList list)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- if (list.numChildren > 0)
- {
- UI_MateriasListItem listItem = UI_MateriasListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.m_loaderIcon, true, "这里可以查看合成需要的材料,和材料的获取途径", 0, false);
- return;
- }
- }
- }
- }
- public static void TryGuideClothingSyntheticViewBtnProduction(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- ShowGuide(target, true, "点击合成物品");
- }
- }
- public static void TryGuideClothingSyntheticViewBtnHome(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- ShowGuide(target, true, "获得必需品啦,继续通关主线剧情吧");
- }
- }
- /************************************************************引导使用卡牌战斗*******************************************************/
- public static void TryGuideStoryCardChoose(GList list)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
- && StoryDataManager.CheckLevelPass(2, 5)
- && !StoryDataManager.CheckLevelPass(2, 6)
- && StoryDataManager.currentChapter == 2 && StoryDataManager.currentLevel == 6)
- {
- if (list.numChildren > 0)
- {
- UI_ListCardItem listItem = UI_ListCardItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- GuideDataManager.currentGuideId = ConstGuideId.USE_CARD_FIGHT;
- ShowGuide(listItem.target, true, "选择一张合适的词牌,增加过关战斗力");
- return;
- }
- }
- }
- }
- public static void TryGuideStoryCardChooseBtnConfirm(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.USE_CARD_FIGHT) <= 0
- && StoryDataManager.CheckLevelPass(2, 5)
- && !StoryDataManager.CheckLevelPass(2, 6))
- {
- ShowGuide(target, true, "点击确定进行战斗");
- }
- }
- /*****************************************************************提示标签**************************************************/
- public static void TryGuideStoryLevelInfoListTag(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.TIPS_TAGS_FIGHT) <= 0
- && StoryDataManager.CheckLevelPass(2, 7)
- && !StoryDataManager.CheckLevelPass(2, 8))
- {
- GuideDataManager.currentGuideId = ConstGuideId.TIPS_TAGS_FIGHT;
- ShowGuide(target, true, "选择相应的关卡标签,可提高分数", 0, true);
- }
- }
- /***********************************************************词牌升星********************************************************/
- public static void TryGuideStoryLevelInfoBtnHome(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
- && StoryDataManager.CheckLevelPass(2, 14)
- && !StoryDataManager.CheckLevelPass(2, 15))
- {
- GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
- ShowGuide(target, true, "已经收集了足够的材料,可以给词牌升星了", 0, true);
- }
- }
- public static void TryGuideMainUIViewBtnCiPai(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
- && StoryDataManager.CheckLevelPass(2, 14)
- && !StoryDataManager.CheckLevelPass(2, 15))
- {
- GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
- ShowGuide(target, true, "点击词牌", 0);
- }
- }
- public static void TryGuideCardDetailViewList(GList list)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
- && StoryDataManager.CheckLevelPass(2, 14)
- && !StoryDataManager.CheckLevelPass(2, 15))
- {
- if (list.numChildren > 0)
- {
- UI.Card.UI_ListCardItem listItem = UI.Card.UI_ListCardItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- GuideDataManager.currentGuideId = ConstGuideId.CARD_UP_STAR;
- ShowGuide(listItem.target, true, "选择可升星的词牌", 0);
- return;
- }
- }
- }
- }
- public static void TryGuideCardFosterViewBtnStar(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CARD_UP_STAR) <= 0
- && StoryDataManager.CheckLevelPass(2, 14)
- && !StoryDataManager.CheckLevelPass(2, 15))
- {
- ShowGuide(target, true, "升满5星后,可解锁词牌的隐藏卡面哦", 0);
- }
- }
- /***********************************************************引导拍照********************************************************/
- // PHOTOGRAPH_GUIDE
- public static bool TryGuideGoBackStoryChapter1(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "拍照功能已开启,解锁更多搭配和玩法哦,点这里看看吧", 0);
- return true;
- }
- return false;
- }
- public static bool TryGuideOpenDressUpView(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "点击自由换装", 0);
- return true;
- }
- return false;
- }
- public static bool TryGuideDressUpViewMenuType2(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "点击拍照", 0);
- return true;
- }
- return false;
- }
- public static void TryGuideDressUpViewMenuPart1(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "可以自由添加已有道具", 0);
- }
- }
- public static bool TryGuideBtnPhotograph(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "点击空白处查看整体效果", 0);
- return true;
- }
- return false;
- }
- public static bool TryGuideOpenPhotographView(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "双指可控制放大缩小,或点击边框上的按键控制", 0);
- return true;
- }
- return false;
- }
- public static bool TryGuideBtnSave(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.PHOTOGRAPH_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 4)
- && !StoryDataManager.CheckLevelPass(2, 5))
- {
- GuideDataManager.currentGuideId = ConstGuideId.PHOTOGRAPH_GUIDE;
- ShowGuide(target, false, "点击拍照,可以记录和分享美照啦~", 0);
- return true;
- }
- return false;
- }
- /*********************************************************************************************************************************/
- public static bool useNewGuide = true;
- public static bool TryGuide(GObject target, string guideKey, int index, string guideStr = null, bool isList = false, int listIndex = 0, bool checkInde = true, bool needUpdate = false, int yTxt = 0, float devWidth = 0, float devHeight = 0)
- {
- if (!useNewGuide) return false;
- GuideCfg cfg = GuideCfgArray.Instance.GetCfg(guideKey);
- if (GuideDataManager.GetGuideCountCopy(guideKey) <= 0
- && (!checkInde || checkInde && GuideDataManager.IsGuideIndexFinish(cfg.id, index - 1) == true && GuideDataManager.IsGuideIndexFinish(cfg.id, index) == false)
- && (GuideDataManager.currentGuideId == 0 || GuideDataManager.currentGuideId == cfg.id && GuideDataManager.currentGuideIdIndex != index)
- && StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level - 1)
- && !StoryDataManager.CheckLevelPass(cfg.chapterId, cfg.level))
- {
- GuideDataManager.currentGuideId = cfg.id;
- GuideDataManager.currentGuideIdIndex = index;
- GuideDataManager.SetGuideIndex(cfg.id, index);
- if (isList)
- {
- if (target.asList.numItems > 0)
- {
- GObject item = (target.asList).GetChildAt(listIndex);
- if (item != null)
- {
- target = item;
- // target.asList.ScrollToView(listIndex);
- }
- }
- else
- {
- return false;
- }
- }
- ShowGuideIndex(target, needUpdate, guideStr, yTxt, cfg.optionalGuide == 1, devWidth, devHeight, GuideDataManager.currentGuideId, GuideDataManager.currentGuideIdIndex);
- if (!checkInde)
- {
- for (int i = 1; i < index; i++)
- {
- GuideDataManager.TryCompleteGuideIndex(cfg.id, i, false);
- }
- }
- return true;
- }
- return false;
- }
- private static void ShowGuideIndex(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0, int guideId = 0, int index = 0)
- {
- HideGuideIndex();
- if (GameGlobal.skipGuide)
- {
- return;
- }
- ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, isOptionalGuide, devWidth, devHeight, guideId, index });
- }
- public static bool TryCompleteGuideIndex(int guideId, int index)
- {
- if (!useNewGuide) return false;
- HideGuideIndex();
- // bool result = GuideDataManager.TryCompleteGuideIndex(guideId, index);
- if (GuideDataManager.TryCompleteGuideIndex(guideId, index))
- {
- return true;
- }
- return false;
- }
- public static bool TryCompleteGuide(string guideKey, int count)
- {
- if (!useNewGuide) return false;
- GuideCfg cfg = GuideCfgArray.Instance.GetCfg(guideKey);
- if (!GuideDataManager.CheckAllIndexFinish(cfg.id, count)) return false;
- bool result = GuideDataManager.TryCompleteGuide(cfg.id);
- if (result)
- {
- GuideDataManager.currentGuideId = 0;
- HideGuideIndex();
- }
- return result;
- }
- public static void HideGuideIndex()
- {
- if (!useNewGuide) return;
- ViewManager.Hide(ViewName.GUIDE_VIEW);
- }
- /************************************************************************************************************/
- public static bool TryGuideByGuideId(GObject target, int guideId, int maxCount = 1, bool needUpdate = false, string guideStr = null, int yTxt = 0, int preGuideIdAtThisLogin = 0)
- {
- if (GuideController.useNewGuide) return false;
- if (preGuideIdAtThisLogin > 0 && !GuideDataManager.CheckGuideIsCompletedAtThisLogin(preGuideIdAtThisLogin))
- {
- return false;
- }
- if (GuideDataManager.GetGuideCount(guideId) < maxCount)
- {
- GuideDataManager.currentGuideId = guideId;
- ShowGuide(target, needUpdate, guideStr, yTxt);
- return true;
- }
- return false;
- }
- public static bool TryCompleteGuide(int guideId)
- {
- if (useNewGuide) return false;
- bool result = GuideDataManager.TryCompleteGuide(guideId);
- if (result)
- {
- HideGuide();
- }
- return result;
- }
- public static void HideGuide()
- {
- if (useNewGuide) return;
- ViewManager.Hide(ViewName.GUIDE_VIEW);
- }
- private static void ShowGuide(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, bool isOptionalGuide = false, float devWidth = 0, float devHeight = 0)
- {
- if (useNewGuide) return;
- HideGuide();
- if (GameGlobal.skipGuide)
- {
- return;
- }
- ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, isOptionalGuide, devWidth, devHeight
- });
- }
- }
- }
|