Parcourir la source

章节开启关卡特效,章节问题处理

zhangyuqian il y a 1 an
Parent
commit
b4feaa3b8d

+ 9 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_ComEff.cs

@@ -8,6 +8,9 @@ namespace UI.Main
     {
         public GComponent target;
         public GGraph m_holder;
+        public GGraph m_effect_jq;
+        public GGraph m_effect_zd;
+        public GGraph m_effect_jq_left;
         public const string URL = "ui://mfvz4q8ko4m7fss";
         public const string PACKAGE_NAME = "Main";
         public const string RES_NAME = "ComEff";
@@ -56,10 +59,16 @@ namespace UI.Main
         private void Init(GComponent comp)
         {
             m_holder = (GGraph)comp.GetChild("holder");
+            m_effect_jq = (GGraph)comp.GetChild("effect_jq");
+            m_effect_zd = (GGraph)comp.GetChild("effect_zd");
+            m_effect_jq_left = (GGraph)comp.GetChild("effect_jq_left");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_holder = null;
+            m_effect_jq = null;
+            m_effect_zd = null;
+            m_effect_jq_left = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 7 - 7
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterListView.cs

@@ -124,15 +124,15 @@ namespace GFGGame
             {
                 if (MainStoryDataManager.CheckChapterUnlock(chapterID))
                 {
-                    if (chapterIndex == chapterCfg.order)
-                    {
-                        this.Hide();
-                    }
-                    else
-                    {
+                    //if (chapterIndex == chapterCfg.order)
+                    //{
+                    //    this.Hide();
+                    //}
+                    //else
+                    //{
                         ViewManager.Show<StoryChapterView>(new object[] { chapterID, _ui.m_listType.selectedIndex });
                         this.Hide();
-                    }
+                    //}
 
                 }
                 else

+ 57 - 25
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -91,9 +91,9 @@ namespace GFGGame
             });
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
 
-            _comEff = new GComponent();
-            _comEff = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
-            _effectUI1 = EffectUIPool.CreateEffectUI(_comEff.GetChild("holder").asGraph, "ui_gk", "ui_gk_sg");
+            //_comEff = new GComponent();
+            //_comEff = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
+            //_effectUI1 = EffectUIPool.CreateEffectUI(_comEff.GetChild("holder").asGraph, "ui_gk", "ui_gk_sg");
 
             _effFirst = new GComponent();
             _effFirst = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
@@ -135,13 +135,23 @@ namespace GFGGame
 
             Timers.inst.StartCoroutine(InitChapter());
 
-            Timers.inst.Add(0.5f,1,SetContainerY);
+            Timers.inst.Add(0.5f, 1, SetContainerY);
 
             _valueBarController.OnShown();
 
             _ui.target.touchable = true;
 
             Timers.inst.AddUpdate(CheckGuide);
+
+            //根据困难程度选择显示图片
+            if (currentDifficulty == 1)
+            {
+                _ui.m_loaBg.url = ResPathUtil.GetSceneBgPath("zhangjie_bg", "png");
+            }
+            else
+            {
+                _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zxian_bg3");
+            }
         }
 
         protected override void OnHide()
@@ -227,8 +237,8 @@ namespace GFGGame
             {
                 _ui.m_chapter.m_compChapterScroll.m_imgBegin.visible = true;
             }
-                _comEff.visible = false;
-            _effFirst.visible = false;
+            //_comEff.visible = false;
+            //_effFirst.visible = false;
             for (int i = 0; i < 20; i++)
             {
                 GObject obj = _ui.m_chapter.m_compChapterScroll.target.GetChild("g" + (19 - i + 1));
@@ -311,24 +321,48 @@ namespace GFGGame
                         //设置为解锁关卡
                         MainStoryDataManager.currentLevelCfgId = levelCfg.id;
                         _unPasslevelItem = levelItem.target;
-                        levelItem.target.AddChild(_comEff);
-                        _comEff.visible = true;
+                        //levelItem.target.AddChild(_comEff);
+                        //_comEff.visible = true;
 
                         //设置解锁特效
-                        //string effName;
-                        //if ( currentDifficulty == 0 )
-                        //{
-                        //    effName = effArray[levelItem.m_c1.selectedIndex];
-                        //}
-                        //else
-                        //{
-                        //    effName = effArray[levelItem.m_c1.selectedIndex] + "_Blue";
-                        //}
-                        //_effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("holder").asGraph, "ui_zj", effName);
-                        //levelItem.target.AddChild(_effFirst);
-                        //levelItem.m_fightBg.visible = false;
-                        //levelItem.m_loaDialogBg.visible = false;
-                        //_effFirst.visible = true;
+                        string effName;
+                        if (currentDifficulty == 0)
+                        {
+                            effName = effArray[levelItem.m_c1.selectedIndex];
+                        }
+                        else
+                        {
+                            effName = effArray[levelItem.m_c1.selectedIndex] + "_Bule";
+                        }
+                        if(levelItem.m_c1.selectedIndex == 0)
+                        {  
+                            if (levelItem.m_c2.selectedIndex == 0)
+                            {
+                                _effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_jq_left").asGraph, "ui_zj", effName);
+                                _effFirst.GetChild("effect_jq_left").rotationY = 180;
+                            }
+                            else
+                            {
+                                _effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_jq").asGraph, "ui_zj", effName);
+                                _effFirst.GetChild("effect_jq").rotationY = 0;
+                            }
+                        }
+                        else
+                        {
+                            _effectUI2 = EffectUIPool.CreateEffectUI(_effFirst.GetChild("effect_zd").asGraph, "ui_zj", effName);
+                            if (levelItem.m_c2.selectedIndex == 0)
+                            {
+                                _effFirst.GetChild("effect_zd").rotationY = 0;
+                            }
+                            else
+                            {
+                                _effFirst.GetChild("effect_zd").rotationY = 180;
+                            }
+                        }
+                        levelItem.target.AddChild(_effFirst);
+                        levelItem.m_fightBg.visible = false;
+                        levelItem.m_loaDialogBg.visible = false;
+                        _effFirst.visible = true;
                         //Timers.inst.Add(1.7f, 1, HideEffect, obj);
                     }
                     if (levelCfg.order > endLevel)
@@ -358,8 +392,6 @@ namespace GFGGame
 
         private void HideEffect(object param = null)
         {
-            //UI_CompStoryLevelItem.Proxy(param as GObject).m_fightBg.visible = true;
-            _comEff.visible = true;
             //_effFirst.visible = false;
         }
 
@@ -447,7 +479,7 @@ namespace GFGGame
             }
             else
             {
-                Timers.inst.Remove(CheckGuide);
+            Timers.inst.Remove(CheckGuide);
             }
         }
 

+ 9 - 0
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -306,6 +306,15 @@ namespace GFGGame
                 }
                 else if (!MainStoryDataManager.CheckChapterUnlock(chapterCfg.id))
                 {
+                    StoryChapterCfg chapterTowCfg = _chapterCfgs[Mathf.Max(0, i - 1)];
+                    var list = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(chapterTowCfg.type, chapterTowCfg.subType, chapterTowCfg.id);
+                    StoryLevelCfg lastLevelCfg = list[list.Count - 1];
+                    if (lastLevelCfg != null && MainStoryDataManager.CheckLevelUnlock(lastLevelCfg.id))
+                    {
+                        ViewManager.Show<StoryChapterListView>(new object[] { 0 ,Mathf.Max(0, chapterCfg.order - 1 )});
+                        isOpen = false;
+                        return;
+                    }
                     ViewManager.Show<StoryChapterView>(new object[] { chapterCfg.id - 1, 0 });
                     isOpen = false;
                     return;

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeAddUpView.cs

@@ -84,6 +84,7 @@ namespace GFGGame
             _ui.m_list.ScrollToView(_curSelectIndex);
             _ui.m_btnLeft.visible = _curSelectIndex == 0 ? false : true;
             _ui.m_btnRight.visible = _curSelectIndex < _ui.m_list.numItems - 1 ? true : false;
+            _ui.m_comVipLv.m_loaIcon.url = ResPathUtil.GetIconPath("tb_hyjf", "png");
             ShopViewManager.Instance.UpdateVipProgressCom(_ui.m_comVipLv.target);
             UpdateRedDot();
         }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeView.cs

@@ -51,7 +51,7 @@ namespace GFGGame
             base.OnShown();
             _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_CHARGE, ConstStoreSubId.STORE_CHARGE);
             _valueBarController.OnShown();
-            _ui.m_comVipLv.m_loaIcon.url = ResPathUtil.GetIconPath("tb_yajizijin", "png");
+            _ui.m_comVipLv.m_loaIcon.url = ResPathUtil.GetIconPath("tb_hyjf", "png");
             UpdateView();
         }
 

BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes