123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510 |
- 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);
- }
- }
- 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_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, false, "这里是物品产出的所有来源,点击服装店");
- }
- }
- }
- public static void TryGuideClothingShopViewBtnBug(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.CLOTHING_SHOP_VIEW_BTN_BUY) <= 0
- && StoryDataManager.currentLevel == 4
- && !StoryDataManager.CheckLevelPass(StoryDataManager.currentChapter, StoryDataManager.currentLevel)
- && DressUpMenuItemDataManager.GetRecommendCount() >= 2)
- {
- ShowGuide(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_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, "点击必需品图标");
- _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_PartsListItem listItem = UI_PartsListItem.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, 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)
- {
- Debug.Log(StoryDataManager.CheckLevelPass(1, 10));
- 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_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.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_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, true, "点击图标,可换上整套衣服");
- return;
- }
- }
- }
- }
- /************************************************************引导合成套装*******************************************************/
- 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);
- }
- }
- public static void TryGuideStoryLevelInfoView(GObject target)
- {
- if (GuideDataManager.GetGuideCount(ConstGuideId.SUIT_SYNTHETIC_GUIDE) <= 0
- && StoryDataManager.CheckLevelPass(2, 1)
- && !StoryDataManager.CheckLevelPass(2, 2))
- {
- 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 void 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);
- }
- }
- 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_PartsListItem listItem = UI_PartsListItem.Proxy(list.GetChildAt(0));
- if (listItem != null)
- {
- ShowGuide(listItem.target, true, "点击套装");
- 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, "点击查看制作材料");
- 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 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 bool TryGuideByGuideId(GObject target, int guideId, int maxCount = 1, bool needUpdate = false, string guideStr = null, int yTxt = 0, int preGuideIdAtThisLogin = 0)
- {
- 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)
- {
- bool result = GuideDataManager.TryCompleteGuide(guideId);
- if (result)
- {
- HideGuide();
- }
- return result;
- }
- public static void HideGuide()
- {
- ViewManager.Hide(ViewName.GUIDE_VIEW);
- }
- private static void ShowGuide(GObject target, bool needUpdate = false, string guideStr = null, int yTxt = 0, float devWidth = 0, float devHeight = 0)
- {
- HideGuide();
- if (GameGlobal.skipGuide)
- {
- return;
- }
- ViewManager.Show(ViewName.GUIDE_VIEW, new List<object> { target, needUpdate, guideStr, yTxt, devWidth, devHeight });
- }
- }
- }
|