瀏覽代碼

Merge remote-tracking branch 'origin/master' into ios

gfg 1 年之前
父節點
當前提交
9fc765083d

+ 3 - 1
GameClient/Assets/Editor/BuildEditor/BuildDllHelper.cs

@@ -4,6 +4,7 @@ using UnityEditor;
 using UnityEngine;
 using GFGGame;
 using HybridCLR.Editor.Commands;
+using System.Collections.Generic;
 
 namespace GFGEditor
 {
@@ -31,7 +32,8 @@ namespace GFGEditor
             {
                 Directory.CreateDirectory(LauncherConfig.DllDirHotfix);
             }
-            foreach (var dll in SettingsUtil.HotUpdateAssemblyFiles)
+            List<string> HotUpdateAssemblyFiles = new List<string>() { "Game.HotUpdate.dll" };
+            foreach (var dll in HotUpdateAssemblyFiles)
             {
                 string dllPath = $"{hotfixDllSrcDir}/{dll}";
                 string dllBytesPath = $"{hotfixAssembliesDstDir}{dll}.bytes";

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Travel/UI_TravelUI.cs

@@ -13,6 +13,7 @@ namespace UI.Travel
         public GGraph m_bg_eff;
         public GComponent m_comValueBar;
         public GButton m_btnback;
+        public GGraph m_db_loadingEff_holder;
         public GGraph m_travellingDB_eff;
         public GTextField m_txtTime;
         public GGraph m_txt_eff;
@@ -76,6 +77,7 @@ namespace UI.Travel
             m_bg_eff = (GGraph)comp.GetChild("bg_eff");
             m_comValueBar = (GComponent)comp.GetChild("comValueBar");
             m_btnback = (GButton)comp.GetChild("btnback");
+            m_db_loadingEff_holder = (GGraph)comp.GetChild("db_loadingEff_holder");
             m_travellingDB_eff = (GGraph)comp.GetChild("travellingDB_eff");
             m_txtTime = (GTextField)comp.GetChild("txtTime");
             m_txt_eff = (GGraph)comp.GetChild("txt_eff");
@@ -95,6 +97,7 @@ namespace UI.Travel
             m_bg_eff = null;
             m_comValueBar = null;
             m_btnback = null;
+            m_db_loadingEff_holder = null;
             m_travellingDB_eff = null;
             m_txtTime = null;
             m_txt_eff = null;

+ 11 - 2
GameClient/Assets/Game/HotUpdate/Sound/VoiceManager.cs

@@ -74,11 +74,20 @@ namespace GFGGame
             player.clip = null;
         }
 
-        public int GetClipLength()
+        public float GetClipLength()
         {
             if (player.clip != null)
             {
-                return (int)Mathf.Ceil(player.clip.length);
+                return player.clip.length;
+            }
+            return 0;
+        }
+
+        public float GetClipRemainingLength()
+        {
+            if (player.clip != null)
+            {
+                return Mathf.Ceil(player.clip.length - player.time);
             }
             return 0;
         }

+ 13 - 1
GameClient/Assets/Game/HotUpdate/Views/BaseWindow.cs

@@ -104,6 +104,18 @@ namespace GFGGame
             }
         }
 
+
+        /// <summary>
+        /// 刷新界面
+        /// </summary>
+        protected override void BringToFront()
+        {
+            if (_window != null)
+            {
+                this._window.BringToFront();
+            }
+        }
+
         protected override void OnInit()
         {
             base.OnInit();
@@ -119,7 +131,7 @@ namespace GFGGame
             base.OnShown();
             CheckCreateCloseButton();
         }
-
+        
         protected override void OnHide()
         {
             base.OnHide();

+ 10 - 2
GameClient/Assets/Game/HotUpdate/Views/CommonGame/ApproachView.cs

@@ -329,7 +329,16 @@ namespace GFGGame
                     isJump = ViewManager.Show<TaskView>(new object[] { 1 });
                     break;
                 case ConstFunctionId.LEAGUE_PRAY:
-                    isJump = ViewManager.Show<LeaguePrayView>();
+                    if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
+                    {
+                        ViewManager.Show<LeagueView>();
+                        isJump = ViewManager.Show<LeaguePrayView>();
+                    }
+                    else
+                    {
+                        if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(nameof(LeagueView))) return;
+                        PromptController.Instance.ShowFloatTextPrompt("暂未加入雅集");
+                    }
                     break;
                 case ConstFunctionId.LEAGUE_ANSWER:
                     if (LeagueDataManager.Instance.Type == LeagueJoinType.Join)
@@ -342,7 +351,6 @@ namespace GFGGame
                         if (!FunctionOpenDataManager.Instance.CheckIsFunOpenById(nameof(LeagueView))) return;
                         PromptController.Instance.ShowFloatTextPrompt("暂未加入雅集");
                     }
-
                     break;
             }
             if (isJump)

+ 34 - 14
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -142,7 +142,8 @@ namespace GFGGame
             }
 
             IsTeaParty = (bool)datas[4];
-            _autoPlay = IsTeaParty;
+            _autoPlay = _lastStartAutoPlay;
+            _ui.m_btnAutoPlay.selected = _autoPlay;
 
             if (LauncherConfig.netType == LauncherConfig.EnumNetType.TEMP && !InstanceZonesDataManager.CheckLevelPass(MainStoryDataManager.currentLevelCfgId))
             {
@@ -156,7 +157,6 @@ namespace GFGGame
 
             _ui.m_btnSkip.visible = skipable;
             _ui.m_c1.selectedIndex = 0;
-            _ui.m_btnAutoPlay.selected = false;
 
             if (_storyStartID == MainStoryDataManager.priorId)
             {
@@ -180,13 +180,14 @@ namespace GFGGame
             Timers.inst.StartCoroutine(CheckResLoad());
         }
 
+        private bool _lastStartAutoPlay = false;
         protected override void OnHide()
         {
             base.OnHide();
             Timers.inst.Remove(UpdateShake);
             Timers.inst.Remove(OnScreenEffectComplete);
-            Timers.inst.Remove(ShowNextWords);
             ScreenBlackController.Instance.HideBlack();
+            _lastStartAutoPlay = _autoPlay;
             StopAutoPlay();
             VoiceManager.Instance.StopVoice();
 
@@ -407,7 +408,7 @@ namespace GFGGame
             _canClickBtnNext = true;
             if (content.IndexOf("//") >= 0)
             {
-                showList(content);
+                ShowList(content);
             }
             else
             {
@@ -415,7 +416,7 @@ namespace GFGGame
             }
         }
 
-        private void showList(string content)
+        private void ShowList(string content)
         {
             StopAutoPlay();
             _ui.m_btnAutoPlay.enabled = false;
@@ -477,8 +478,14 @@ namespace GFGGame
             string[] effectInfo = storyDialogCfg.effectInfoArr;
 
             VoiceManager.Instance.StopVoice();
-            // 如果配置了语音,读取语音
-            VoiceManager.Instance.LoadRes(ResPathUtil.GetVoicePath(storyDialogCfg.voiceRes));
+
+            // 如果没开倍速才加载语音
+            if(_speedAutoPlay == 1 || !_autoPlay)
+            {
+                // 如果配置了语音,读取语音
+                VoiceManager.Instance.LoadRes(ResPathUtil.GetVoicePath(storyDialogCfg.voiceRes));
+            }
+
             _wordList = Regex.Split(words, "&&");
 
             // 有对话
@@ -669,7 +676,7 @@ namespace GFGGame
             _wordIndex++;
             if (_autoPlay)
             {
-                int interval = (int)Mathf.Max(VoiceManager.Instance.GetClipLength(), GameConst.NEXT_WORDS_INTERVAL_MAX / _speedAutoPlay);
+                float interval = Mathf.Max(VoiceManager.Instance.GetClipRemainingLength(), GameConst.NEXT_WORDS_INTERVAL_MAX / _speedAutoPlay);
                 Timers.inst.Add(interval, 1, ShowNextWords);
             }
         }
@@ -1004,12 +1011,22 @@ namespace GFGGame
             );
         }
 
+        private RenderTexture renderTexure;
         private void CreateHeadImg()
         {
+            // 创建render texture
+            renderTexure = new RenderTexture(550, 760, 24);
+
             // 换装父节点 + 相机
             _dressUpSceneObj = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("StoryDialogSelfImg/StoryDialogDressUpObj"));
+            Camera camera = _dressUpSceneObj.transform.Find("Camera").GetComponent<Camera>();
+            camera.targetTexture = renderTexure;
+
             // 创建RawImg
             _selfHeadImgObj = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("StoryDialogSelfImg/Canvas"));
+            RawImage rawImage = _selfHeadImgObj.transform.Find("mask/RawImage").GetComponent<RawImage>();
+            rawImage.texture = renderTexure;
+
             // 将RawImg放在FGUI上
             GoWrapper goWrapper = new GoWrapper(_selfHeadImgObj);
             _ui.m_dialogHead.m_compDressUp.m_holder.SetNativeObject(goWrapper);
@@ -1022,10 +1039,17 @@ namespace GFGGame
 
         private void DestroyHeadImg()
         {
+            // 清空render Texture
             Camera camera = _dressUpSceneObj.transform.Find("Camera").GetComponent<Camera>();
             camera.targetTexture = null;
-            Transform parent = _dressUpSceneObj.transform.Find("Role");
-            ChangeLayer(parent, 0);
+            RawImage rawImage = _selfHeadImgObj.transform.Find("mask/RawImage").GetComponent<RawImage>();
+            rawImage.texture = null;
+            renderTexure.Release();
+            renderTexure = null;
+
+            // 回收人物
+            _dressUpObj?.Dispose();
+            _dressUpObj = null;
 
             // 回收RawImage
             if (_selfHeadImgObj != null)
@@ -1040,10 +1064,6 @@ namespace GFGGame
                 PrefabManager.Instance.Restore(_dressUpSceneObj);
                 _dressUpSceneObj = null;
             }
-
-            // 回收人物
-            _dressUpObj?.Dispose();
-            _dressUpObj = null;
         }
 
         /// <summary>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Views/Travel/TravelView.cs

@@ -58,6 +58,9 @@ namespace GFGGame
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("cj_bg_ychm");
 
             _effectUIDic.Add("XQFS_Kuang_All", EffectUIPool.CreateEffectUI(_ui.m_bg_eff, "ui_HaiZhiShi", "XQFS_Kuang_All"));
+            _effectUIDic.Add("XQFS_DouBao01", EffectUIPool.CreateEffectUI(_ui.m_btnGo.m_btnGo_db_eff, "ui_HaiZhiShi", "XQFS_DouBao01"));
+            _effectUIDic.Add("XQFS_DouBao_Loading", EffectUIPool.CreateEffectUI(_ui.m_db_loadingEff_holder, "ui_HaiZhiShi", "XQFS_DouBao_Loading"));
+
             // 省略号特效
             _effectUIDic.Add("XQFS_Text_Loading", EffectUIPool.CreateEffectUI(_ui.m_txt_eff, "ui_HaiZhiShi", "XQFS_Text_Loading"));
             _effectUIDic.Add("XQFS_Button_YouLi", EffectUIPool.CreateEffectUI(_ui.m_btnGo.m_btnGo_eff, "ui_HaiZhiShi", "XQFS_Button_YouLi"));

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Views/UIView.cs

@@ -126,6 +126,7 @@ namespace GFGGame
             object temp = viewData;
             this.OnHide();
             this.viewData = temp;
+            this.BringToFront();
             this.OnShown();
         }
 
@@ -133,6 +134,10 @@ namespace GFGGame
         {
         }
 
+        virtual protected void BringToFront()
+        {
+        }
+
         public virtual void Hide()
         {
             // UIPackageManager.Instance.RemovePackageView(_descFilePath, viewName);

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

@@ -228,6 +228,7 @@ namespace GFGGame
                 }
                 if (!hasShowingView || (viewStructure.iUIView.isReturnView && viewStructure.name == viewName))
                 {
+                    //关闭自己,在队列里去除
                     if(viewStructure.iUIView.isReturnView && viewStructure.name == viewName)
                         _viewStack.RemoveAt(_viewStack.Count - 1);
 

+ 1 - 1
GameClient/Assets/ResIn/Prefab/StoryDialogSelfImg/Canvas.prefab

@@ -65,7 +65,7 @@ MonoBehaviour:
   m_OnCullStateChanged:
     m_PersistentCalls:
       m_Calls: []
-  m_Texture: {fileID: 8400000, guid: d75358a96d5bdc349947ff8414ae83f6, type: 2}
+  m_Texture: {fileID: 0}
   m_UVRect:
     serializedVersion: 2
     x: 0

+ 0 - 38
GameClient/Assets/ResIn/Prefab/StoryDialogSelfImg/SelfRenderTexture.renderTexture

@@ -1,38 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!84 &8400000
-RenderTexture:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_Name: SelfRenderTexture
-  m_ImageContentsHash:
-    serializedVersion: 2
-    Hash: 00000000000000000000000000000000
-  m_ForcedFallbackFormat: 4
-  m_DownscaleFallback: 0
-  m_IsAlphaChannelOptional: 0
-  serializedVersion: 3
-  m_Width: 550
-  m_Height: 760
-  m_AntiAliasing: 1
-  m_MipCount: -1
-  m_DepthFormat: 2
-  m_ColorFormat: 8
-  m_MipMap: 0
-  m_GenerateMips: 1
-  m_SRGB: 0
-  m_UseDynamicScale: 0
-  m_BindMS: 0
-  m_EnableCompatibleFormat: 1
-  m_TextureSettings:
-    serializedVersion: 2
-    m_FilterMode: 1
-    m_Aniso: 0
-    m_MipBias: 0
-    m_WrapU: 1
-    m_WrapV: 1
-    m_WrapW: 1
-  m_Dimension: 2
-  m_VolumeDepth: 1

+ 0 - 8
GameClient/Assets/ResIn/Prefab/StoryDialogSelfImg/SelfRenderTexture.renderTexture.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: d75358a96d5bdc349947ff8414ae83f6
-NativeFormatImporter:
-  externalObjects: {}
-  mainObjectFileID: 8400000
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 1 - 1
GameClient/Assets/ResIn/Prefab/StoryDialogSelfImg/StoryDialogDressUpObj.prefab

@@ -115,7 +115,7 @@ Camera:
     serializedVersion: 2
     m_Bits: 64
   m_RenderingPath: -1
-  m_TargetTexture: {fileID: 8400000, guid: d75358a96d5bdc349947ff8414ae83f6, type: 2}
+  m_TargetTexture: {fileID: 0}
   m_TargetDisplay: 0
   m_TargetEye: 3
   m_HDR: 1

二進制
GameClient/Assets/ResIn/UI/Travel/Travel_atlas0!a.png


二進制
GameClient/Assets/ResIn/UI/Travel/Travel_atlas0.png


二進制
GameClient/Assets/ResIn/UI/Travel/Travel_fui.bytes


+ 1 - 0
GameClient/Assets/ThirdParty/FairyGUI/Scripts/UI/Window.cs

@@ -277,6 +277,7 @@ namespace FairyGUI
         public void BringToFront()
         {
             this.root.BringToFront(this);
+            this.root.AdjustModalLayer();
         }
 
         /// <summary>

+ 1 - 1
GameClient/Packages/manifest.json

@@ -1,6 +1,6 @@
 {
   "dependencies": {
-    "com.focus-creative-games.hybridclr_unity": "https://gitee.com/focus-creative-games/hybridclr_unity.git",
+    "com.code-philosophy.hybridclr": "https://gitee.com/focus-creative-games/hybridclr_unity.git#v3.4.2",
     "com.unity.2d.animation": "5.2.0",
     "com.unity.2d.psdimporter": "4.3.0",
     "com.unity.2d.sprite": "1.0.0",

+ 3 - 3
GameClient/Packages/packages-lock.json

@@ -1,11 +1,11 @@
 {
   "dependencies": {
-    "com.focus-creative-games.hybridclr_unity": {
-      "version": "https://gitee.com/focus-creative-games/hybridclr_unity.git",
+    "com.code-philosophy.hybridclr": {
+      "version": "https://gitee.com/focus-creative-games/hybridclr_unity.git#v3.4.2",
       "depth": 0,
       "source": "git",
       "dependencies": {},
-      "hash": "c85adbe65b9c4adac183de716c3044f93358388a"
+      "hash": "1f9faf49a3ac4b6b5417188cd7579084d7563514"
     },
     "com.unity.2d.animation": {
       "version": "5.2.0",

+ 3 - 4
GameClient/ProjectSettings/HybridCLRSettings.asset

@@ -14,17 +14,16 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   enable: 1
   useGlobalIl2cpp: 0
-  cloneHomeURL: https://gitee.com/focus-creative-games
+  hybridclrRepoURL: https://gitee.com/focus-creative-games/hybridclr
+  il2cppPlusRepoURL: https://gitee.com/focus-creative-games/il2cpp_plus
   hotUpdateAssemblyDefinitions:
   - {fileID: 5897886265953266890, guid: 46e5d16512650f34ca18c2edd2331c78, type: 3}
   hotUpdateAssemblies: []
   preserveHotUpdateAssemblies: []
   hotUpdateDllCompileOutputRootDir: HybridCLRData/HotUpdateDlls
+  externalHotUpdateAssembliyDirs: []
   strippedAOTDllOutputRootDir: HybridCLRData/AssembliesPostIl2CppStrip
   patchAOTAssemblies: []
-  differentialHybridAssemblies: []
-  differentialHybridOptionOutputDir: Assets/StreamingAssets
-  collectAssetReferenceTypes: 0
   outputLinkFile: HybridCLRData/Generated/link.xml
   outputAOTGenericReferenceFile: HybridCLRData/Generated/AOTGenericReferences.cs
   maxGenericReferenceIteration: 10