Переглянути джерело

添加音量的调节和保存
添加主界面背景预览逻辑

leiyasi 1 рік тому
батько
коміт
a2363f11bd
31 змінених файлів з 641 додано та 48 видалено
  1. 53 7
      GameClient/Assets/Game/HotUpdate/Data/RoleInfoManager.cs
  2. 3 1
      GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs
  3. 6 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_MainUI.cs
  4. 86 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_MainBgChooseUI.cs
  5. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_MainBgChooseUI.cs.meta
  6. 18 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_SettingUI.cs
  7. 89 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_SettingUI_old.cs
  8. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_SettingUI_old.cs.meta
  9. 74 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_bgItem.cs
  10. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_bgItem.cs.meta
  11. 21 16
      GameClient/Assets/Game/HotUpdate/Sound/MusicManager.cs
  12. 9 1
      GameClient/Assets/Game/HotUpdate/Sound/SoundManager.cs
  13. 16 5
      GameClient/Assets/Game/HotUpdate/Sound/VoiceManager.cs
  14. 2 2
      GameClient/Assets/Game/HotUpdate/Views/FieldGuide/FieldGuideView.cs
  15. 0 2
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs
  16. 0 9
      GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs
  17. 134 0
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/MainBgChooseView.cs
  18. 11 0
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/MainBgChooseView.cs.meta
  19. 1 0
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/OtherRoleInfoView.cs
  20. 1 1
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/RoleInfoView.cs
  21. 66 2
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/SettingView.cs
  22. 6 0
      GameClient/Assets/Game/Launcher/LauncherConfig.cs
  23. 12 2
      GameClient/Assets/Game/Launcher/LocalCache/LocalCache.cs
  24. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0!a.png
  25. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0.png
  26. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_1!a.png
  27. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_1.png
  28. BIN
      GameClient/Assets/ResIn/UI/Main/Main_fui.bytes
  29. BIN
      GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_atlas0!a.png
  30. BIN
      GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_atlas0.png
  31. BIN
      GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_fui.bytes

+ 53 - 7
GameClient/Assets/Game/HotUpdate/Data/RoleInfoManager.cs

@@ -142,19 +142,66 @@ namespace GFGGame
             });
         }
 
+        /// <summary>
+        /// 套装收集进度
+        /// </summary>
+        /// <returns></returns>
+        public int GetSuitGuideProgress()
+        {
+            DressUpMenuSuitDataManager.GetTotalProgress(out int suitHaveCount, out int suitTotalCount);
+            int value = FieldGuideView.ProgressCalculate(suitHaveCount, suitTotalCount);
+            return value;
+        }
 
-        public decimal GetGuideProgress()
+        /// <summary>
+        /// 卡牌收集进度
+        /// </summary>
+        /// <returns></returns>
+        public int GetCardGuideProgress()
         {
-            int suitHaveCount;
-            int suitTotalCount;
-            DressUpMenuSuitDataManager.GetTotalProgress(out suitHaveCount, out suitTotalCount);
-            decimal value = FieldGuideView.ProgressCalculate(suitHaveCount, suitTotalCount);
+            CardDataManager.GetTotalProgress(out int haveCount, out int totalCount);
+            int value = FieldGuideView.ProgressCalculate(haveCount, totalCount);
             return value;
         }
 
-        public void UpdateHeadWithLv(GComponent component, int headId, int roleBorderId, int lv)
+        /// <summary>
+        /// 成就任务完成进度
+        /// </summary>
+        /// <returns></returns>
+        public int GetTaskAchieveProgress()
+        {
+            var taskTypeProList = TaskDataManager.Instance.GetAchievementTaskTypeProList();
+            int finishedCount = 0;
+            int totalCount = 0;
+            for (int i = 0; i < taskTypeProList.Count; i++)
+            {
+                finishedCount += taskTypeProList[i].CompleteTaskNum;
+                totalCount += taskTypeProList[i].AllTaskNum;
+            }
+            int value = FieldGuideView.ProgressCalculate(finishedCount, totalCount);
+            return value;
+        }
+
+        public string GetLeagueName()
+        {
+            LeagueData leagueData = LeagueDataManager.Instance.LeagueData;
+            if (leagueData.Name.Length == 0)
+            {
+                return "暂未加入雅集";
+            }
+            else
+            {
+                return leagueData.Name;
+            }
+        }
+
+        public long GetRoleID()
         {
+            return RoleDataManager.roleId;
+        }
 
+        public void UpdateHeadWithLv(GComponent component, int headId, int roleBorderId, int lv)
+        {
             UI_ComHeadWithLv comHeadWithLv = UI_ComHeadWithLv.Proxy(component);
             UpdateHead(comHeadWithLv.m_comHead.target, headId, roleBorderId);
             UpdateLv(comHeadWithLv.m_comLv.target, lv);
@@ -163,7 +210,6 @@ namespace GFGGame
         }
         public void UpdateHeadWithLv1(GComponent component, int headId, int roleBorderId, int lv)
         {
-
             UI_ComHeadWithLv1 comHeadWithLv = UI_ComHeadWithLv1.Proxy(component);
 
             ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(headId == 0 ? ConstItemID.HEADID : headId);

+ 3 - 1
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -11,12 +11,14 @@ namespace GFGGame
 {
     public class SceneController
     {
+        // 临时存主界面路径
+        public static string bgTempRes = "zjm_1";  
         public static void UpdateMainScene(GameObject sceneObj)
         {
             //背景0
             Transform tf = sceneObj.transform.Find("Bg");
             SpriteRenderer spr = tf.GetComponent<SpriteRenderer>();
-            var resPath = ResPathUtil.GetBgImgPath("zjm_1");
+            var resPath = ResPathUtil.GetBgImgPath(bgTempRes);
             SpriteHelper.AddSpriteTo(spr, resPath);
             //角色
             CustomSuitData suitSavedData = CustomSuitDataManager.GetCurrentSuitData();

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_MainUI.cs

@@ -7,6 +7,8 @@ namespace UI.Main
     public partial class UI_MainUI
     {
         public GComponent target;
+        public Controller m_type;
+        public GLoader m_loaBg;
         public GComponent m_valueBar;
         public GTextField m_grpLeaguetext;
         public GGroup m_grpLeagueTips;
@@ -83,6 +85,8 @@ namespace UI.Main
 
         private void Init(GComponent comp)
         {
+            m_type = comp.GetController("type");
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_valueBar = (GComponent)comp.GetChild("valueBar");
             m_grpLeaguetext = (GTextField)comp.GetChild("grpLeaguetext");
             m_grpLeagueTips = (GGroup)comp.GetChild("grpLeagueTips");
@@ -115,6 +119,8 @@ namespace UI.Main
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_type = null;
+            m_loaBg = null;
             m_valueBar = null;
             m_grpLeaguetext = null;
             m_grpLeagueTips = null;

+ 86 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_MainBgChooseUI.cs

@@ -0,0 +1,86 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.RoleInfo
+{
+    public partial class UI_MainBgChooseUI
+    {
+        public GComponent target;
+        public GLoader m_loaBg;
+        public GComponent m_mainUIShow;
+        public GButton m_btnBack;
+        public GList m_bgList;
+        public GButton m_btnChange;
+        public Transition m_openViewAction;
+        public const string URL = "ui://374k3dwvc4t79fvz";
+        public const string PACKAGE_NAME = "RoleInfo";
+        public const string RES_NAME = "MainBgChooseUI";
+        private static UI_MainBgChooseUI _proxy;
+
+        public static UI_MainBgChooseUI Create(GObject gObject = null)
+        {
+            var ui = new UI_MainBgChooseUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_MainBgChooseUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_MainBgChooseUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_mainUIShow = (GComponent)comp.GetChild("mainUIShow");
+            m_btnBack = (GButton)comp.GetChild("btnBack");
+            m_bgList = (GList)comp.GetChild("bgList");
+            m_btnChange = (GButton)comp.GetChild("btnChange");
+            m_openViewAction = comp.GetTransition("openViewAction");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaBg = null;
+            m_mainUIShow = null;
+            m_btnBack = null;
+            m_bgList = null;
+            m_btnChange = null;
+            m_openViewAction = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_MainBgChooseUI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2415a8c789b3eb1478b83fe75615594f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 18 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_SettingUI.cs

@@ -12,8 +12,14 @@ namespace UI.RoleInfo
         public GGraph m_holderRightDowm;
         public GButton m_btnLogout;
         public GButton m_btnExit;
+        public GSlider m_musicSlider;
         public GButton m_btnMusic;
         public GButton m_btnSound;
+        public GSlider m_soundSlider;
+        public GSlider m_voiceSlider;
+        public GButton m_btnVoice;
+        public GButton m_btnChooseMainBg;
+        public Transition m_t0;
         public const string URL = "ui://374k3dwvr9ri1";
         public const string PACKAGE_NAME = "RoleInfo";
         public const string RES_NAME = "SettingUI";
@@ -66,8 +72,14 @@ namespace UI.RoleInfo
             m_holderRightDowm = (GGraph)comp.GetChild("holderRightDowm");
             m_btnLogout = (GButton)comp.GetChild("btnLogout");
             m_btnExit = (GButton)comp.GetChild("btnExit");
+            m_musicSlider = (GSlider)comp.GetChild("musicSlider");
             m_btnMusic = (GButton)comp.GetChild("btnMusic");
             m_btnSound = (GButton)comp.GetChild("btnSound");
+            m_soundSlider = (GSlider)comp.GetChild("soundSlider");
+            m_voiceSlider = (GSlider)comp.GetChild("voiceSlider");
+            m_btnVoice = (GButton)comp.GetChild("btnVoice");
+            m_btnChooseMainBg = (GButton)comp.GetChild("btnChooseMainBg");
+            m_t0 = comp.GetTransition("t0");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -76,8 +88,14 @@ namespace UI.RoleInfo
             m_holderRightDowm = null;
             m_btnLogout = null;
             m_btnExit = null;
+            m_musicSlider = null;
             m_btnMusic = null;
             m_btnSound = null;
+            m_soundSlider = null;
+            m_voiceSlider = null;
+            m_btnVoice = null;
+            m_btnChooseMainBg = null;
+            m_t0 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 89 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_SettingUI_old.cs

@@ -0,0 +1,89 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.RoleInfo
+{
+    public partial class UI_SettingUI_old
+    {
+        public GComponent target;
+        public GImage m_bg;
+        public GGraph m_holderLeftTop;
+        public GGraph m_holderRightDowm;
+        public GButton m_btnLogout;
+        public GButton m_btnExit;
+        public GButton m_btnMusic;
+        public GButton m_btnSound;
+        public const string URL = "ui://374k3dwvc4t7gr";
+        public const string PACKAGE_NAME = "RoleInfo";
+        public const string RES_NAME = "SettingUI_old";
+        private static UI_SettingUI_old _proxy;
+
+        public static UI_SettingUI_old Create(GObject gObject = null)
+        {
+            var ui = new UI_SettingUI_old();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_SettingUI_old Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_SettingUI_old();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_bg = (GImage)comp.GetChild("bg");
+            m_holderLeftTop = (GGraph)comp.GetChild("holderLeftTop");
+            m_holderRightDowm = (GGraph)comp.GetChild("holderRightDowm");
+            m_btnLogout = (GButton)comp.GetChild("btnLogout");
+            m_btnExit = (GButton)comp.GetChild("btnExit");
+            m_btnMusic = (GButton)comp.GetChild("btnMusic");
+            m_btnSound = (GButton)comp.GetChild("btnSound");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_bg = null;
+            m_holderLeftTop = null;
+            m_holderRightDowm = null;
+            m_btnLogout = null;
+            m_btnExit = null;
+            m_btnMusic = null;
+            m_btnSound = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_SettingUI_old.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dba6576478267e344acaf514c5334bf5
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 74 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_bgItem.cs

@@ -0,0 +1,74 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.RoleInfo
+{
+    public partial class UI_bgItem
+    {
+        public GButton target;
+        public GLoader m_bgImg;
+        public GGraph m_mask;
+        public const string URL = "ui://374k3dwvc4t7gv";
+        public const string PACKAGE_NAME = "RoleInfo";
+        public const string RES_NAME = "bgItem";
+        private static UI_bgItem _proxy;
+
+        public static UI_bgItem Create(GObject gObject = null)
+        {
+            var ui = new UI_bgItem();
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_bgItem Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_bgItem();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_bgImg = (GLoader)comp.GetChild("bgImg");
+            m_mask = (GGraph)comp.GetChild("mask");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_bgImg = null;
+            m_mask = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_bgItem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ad8f9103233564c45af9e5e1654a1fc8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 16
GameClient/Assets/Game/HotUpdate/Sound/MusicManager.cs

@@ -11,9 +11,9 @@ namespace GFGGame
         private string currentName;
         private AssetOperationHandle handle;
         private Coroutine coroutine;
-        private float normalVolumn = 1f;
-        private float curVolume = 1f;
-        private float changeValue = 0.01f;
+        private float settingVolumn = 1f;       // 设置音量
+        private float tempVolume = 1f;          // 临时音量
+        private float changeBaseValue = 0.01f;  // 缓动单位改变基数
 
         private bool _isOn = true;
         public bool isOn
@@ -43,16 +43,14 @@ namespace GFGGame
             }
         }
 
+
         private void Awake()
         {
             player = this.gameObject.AddComponent<AudioSource>();
             player.loop = true;
             isOn = LocalCache.GetBool(LauncherConfig.MUSIC_KEY, true);
-        }
-
-        private void Start()
-        {
-
+            settingVolumn = LocalCache.GetFloat(LauncherConfig.MUSIC_VOLUMN_KEY, 1);
+            player.volume = settingVolumn;
         }
 
         private void Update()
@@ -62,21 +60,23 @@ namespace GFGGame
                 return;
             }
 
+            // 播放语音时背景音乐变小
             if (VoiceManager.Instance.IsPlaying())
             {
-                curVolume = 0.17f;
+                tempVolume = 0.17f;
             }
             else
             {
-                curVolume = normalVolumn;
+                tempVolume = settingVolumn;
             }
 
-            if (player.volume != curVolume)
+            // 音量缓动变化
+            if (player.volume != tempVolume)
             {
-                player.volume = Mathf.Lerp(player.volume, curVolume, changeValue);
-                if (Mathf.Abs(player.volume - curVolume) <= 0.05)
+                player.volume = Mathf.Lerp(player.volume, tempVolume, changeBaseValue);
+                if (Mathf.Abs(player.volume - tempVolume) <= 0.05)
                 {
-                    player.volume = curVolume;
+                    player.volume = tempVolume;
                 }
             }
         }
@@ -135,9 +135,14 @@ namespace GFGGame
             player.volume = volume;
         }
 
-        public void SetNormalVolumn(float volume)
+        public void SetSettingVolumn(float volume)
+        {
+            settingVolumn = volume;
+        }
+
+        public float GetSettingVolumn()
         {
-            normalVolumn = volume;
+            return settingVolumn;
         }
     }
 }

+ 9 - 1
GameClient/Assets/Game/HotUpdate/Sound/SoundManager.cs

@@ -11,6 +11,7 @@ namespace GFGGame
         private AudioSource player;
         private AssetOperationHandle handle;
         private Coroutine coroutine;
+        private float _lastVolumn = 1;
 
         private bool _isOn = true;
         public bool isOn
@@ -26,10 +27,11 @@ namespace GFGGame
                     _isOn = value;
                     if(_isOn)
                     {
-                        GRoot.inst.soundVolume = 1;
+                        GRoot.inst.soundVolume = _lastVolumn;
                     }
                     else
                     {
+                        _lastVolumn = GRoot.inst.soundVolume;
                         GRoot.inst.soundVolume = 0;
                         Stop();
                     }
@@ -42,6 +44,7 @@ namespace GFGGame
         {
             player = this.gameObject.AddComponent<AudioSource>();
             isOn = LocalCache.GetBool(LauncherConfig.SOUND_KEY, true);
+            player.volume = LocalCache.GetFloat(LauncherConfig.SOUND_VOLUMN_KEY, 1);
         }
 
         private void Start() 
@@ -81,5 +84,10 @@ namespace GFGGame
             player.Stop();
         }
 
+        public void SetVolumn(float volumn)
+        {
+            GRoot.inst.soundVolume = volumn;
+        }
+
     }
 }

+ 16 - 5
GameClient/Assets/Game/HotUpdate/Sound/VoiceManager.cs

@@ -28,14 +28,14 @@ namespace GFGGame
                     _isOn = value;
                     if (_isOn)
                     {
-                        GRoot.inst.soundVolume = 1;
+                        //player.volume = 1;
                     }
                     else
                     {
-                        GRoot.inst.soundVolume = 0;
+                        //player.volume = 0;
                         Stop();
                     }
-                    LocalCache.SetBool(LauncherConfig.SOUND_KEY, _isOn);
+                    LocalCache.SetBool(LauncherConfig.VOICE_KEY, _isOn);
                 }
             }
         }
@@ -46,12 +46,13 @@ namespace GFGGame
             player.priority = 256;
             //设置这个声音会大一些
             player.spatialBlend = 1f;
-            isOn = LocalCache.GetBool(LauncherConfig.SOUND_KEY, true);
+            isOn = LocalCache.GetBool(LauncherConfig.VOICE_KEY, true);
+            player.volume = LocalCache.GetFloat(LauncherConfig.VOICE_VOLUMN_KEY, 1);
         }
 
         public void LoadRes(string path)
         {
-            if (!YooAssets.CheckResExist(path))
+            if (!isOn || !YooAssets.CheckResExist(path))
             {
                 return;
             }
@@ -139,5 +140,15 @@ namespace GFGGame
         {
             return player.isPlaying;
         }
+
+        public void SetVolumn(float volumn)
+        {
+            player.volume = volumn;
+        }
+
+        public float GetVolumn()
+        {
+            return player.volume;
+        }
     }
 }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/FieldGuideView.cs

@@ -57,7 +57,7 @@ namespace GFGGame
                 _ui.m_listGuide.scrollPane.ScrollTop();
                 _ui.m_In.Play();
             }
-            Timers.inst.StartCoroutine(UpdatePrgress());
+            Timers.inst.StartCoroutine(UpdateProgress());
         }
 
         protected override void OnHide()
@@ -187,7 +187,7 @@ namespace GFGGame
             if (totalCount == 0) totalCount = 1;
         }
 
-        private IEnumerator UpdatePrgress()
+        private IEnumerator UpdateProgress()
         {
             int num = _ui.m_listGuide.numChildren;
             bool playAnim = _startInAnim;

+ 0 - 2
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -113,7 +113,6 @@ namespace GFGGame
 
             // 初始化
             MusicManager.Instance.Stop();
-            MusicManager.Instance.SetNormalVolumn(0.6f);
             MusicManager.Instance.SetVolume(0);
             _ui.m_hideAnimMask.Play();
 
@@ -210,7 +209,6 @@ namespace GFGGame
             StoryDialogDataManager.Instance.Clear();
 
             GuideController.TryCompleteGuide(ConstGuideId.ENTER_CHAPTER_5, 3);
-            MusicManager.Instance.SetNormalVolumn(1);
             DestroyHeadImg();
         }
 

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

@@ -29,9 +29,6 @@ namespace GFGGame
         private GButton _btnHaoYou;
         private GButton _btnYouJian;
         private GButton _btnRenWu;
-        private GButton _btnPengYouQuan;
-        private GButton _btnJInShu;
-        private GButton _btnTianGong;
         private GButton _btnLeague;
         private GButton _btnStore;
         private GButton _btnTuJian;
@@ -92,18 +89,12 @@ namespace GFGGame
             _btnGongGao = _ui.m_btnGongGao;
             _btnHaoYou = _ui.m_list.GetChild("btnHaoYou").asButton;
             _btnRenWu = _ui.m_list.GetChild("btnRenWu").asButton;
-            _btnPengYouQuan = _ui.m_list.GetChild("btnPengYouQuan").asButton;
             _btnLeague = _ui.m_list.GetChild("btnLeague").asButton;
             _btnStore = _ui.m_list.GetChild("btnStore").asButton;
-            _btnTianGong = _ui.m_list.GetChild("btnTianGong").asButton;
             _btnTuJian = _ui.m_list.GetChild("btnTuJian").asButton;
-            _btnJInShu = _ui.m_list.GetChild("btnJInShu").asButton;
             _btnBag = _ui.m_list.GetChild("btnBag").asButton;
 
             _btnActivityDay7 = _ui.m_btnActivityDay7.target;
-            _btnPengYouQuan.visible = false;
-            _btnJInShu.visible = false;
-            _btnTianGong.visible = false;
 
             _btns = new UI_ButtonModle1[] { _ui.m_btnHuanZhuang, _ui.m_btnZhaiXing, _ui.m_btnXiuFang, _ui.m_btnCiPai };
             _ui.m_btnMain.target.onClick.Add(OnClickBtnMain);

+ 134 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/MainBgChooseView.cs

@@ -0,0 +1,134 @@
+using System.Collections;
+using UnityEngine;
+using UI.RoleInfo;
+using UI.Main;
+using ET;
+using FairyGUI;
+
+namespace GFGGame
+{
+    public class MainBgChooseView : BaseWindow
+    {
+        private UI_MainBgChooseUI _ui;
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_MainBgChooseUI.PACKAGE_NAME;
+            _ui = UI_MainBgChooseUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+            isReturnView = true;
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tjbg");
+
+            _ui.m_bgList.itemRenderer = BgListItemRenderer;
+            _ui.m_bgList.onClickItem.Add(OnClickBgListItem);
+            _ui.m_btnBack.onClick.Add(OnClickBtnBack);
+            _ui.m_btnChange.onClick.Add(OnClickBtnChange);
+
+            _ui.m_bgList.numItems = tempRes.Length;
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            InitMainUIPreview();
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            ReleaseMainUIPreview();
+        }
+
+
+        private ValueBarController _valueBarController;
+        /// <summary>
+        /// 同步主界面信息
+        /// </summary>
+        private void InitMainUIPreview()
+        {
+            UI_MainUI mainUI = UI_MainUI.Proxy(_ui.m_mainUIShow);
+
+            _valueBarController = new ValueBarController(mainUI.m_valueBar);
+            _valueBarController.OnShown();
+
+            mainUI.m_type.SetSelectedIndex(1);
+            mainUI.m_headBar.m_txtLvl.text = "" + GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
+            RoleInfoManager.Instance.UpdateHead(mainUI.m_headBar.m_comHead, RoleDataManager.headId,
+    RoleDataManager.headBorderId);
+            mainUI.m_headBar.m_txtName.text = RoleDataManager.roleName;
+            mainUI.m_btnXiuFang.m_loaLockIcons.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(XiuFangView).Name, false);
+            mainUI.m_btnHuanZhuang.m_loaLockIcons.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(DressUpView).Name, false);
+            mainUI.m_btnCiPai.m_loaLockIcons.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(CardDetailView).Name, false);
+            mainUI.m_btnZhaiXing.m_loaLockIcons.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(LuckyBoxView).Name, false);
+            mainUI.m_btnMain.m_loaLockIcons.visible = !FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StoryChapterListView).Name, false);
+            
+            mainUI.m_btnGongGao.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(NoticeView).Name, false);
+            mainUI.m_btnYouJian.visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(MailView).Name, false);
+
+            mainUI.m_list.GetChild("btnHaoYou").visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(FriendView).Name, false);
+            mainUI.m_list.GetChild("btnLeague").visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(LeagueView).Name, false);
+            mainUI.m_list.GetChild("btnStore").visible = FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(StoreView).Name, false);
+            mainUI.m_list.GetChild("btnTuJian").visible =
+                FunctionOpenDataManager.Instance.CheckIsFunOpenById(typeof(FieldGuideView).Name, false);
+
+
+            mainUI.m_list.ResizeToFit();
+
+            UI_MainUI.ProxyEnd();
+        }
+
+        private void ReleaseMainUIPreview()
+        {
+            _valueBarController.OnHide();
+            _valueBarController.Dispose();
+        }
+
+        private void OnClickBtnBack()
+        {
+            Hide();
+        }
+
+        // 背景资源名列表,需要从配置表读
+        string[] tempRes = { "zjm_1", "zjm_2", "tc_bjbj" };
+        private void BgListItemRenderer(int index, GObject item)
+        {
+            UI_bgItem bgItem = UI_bgItem.Proxy(item);
+            bgItem.m_bgImg.url = ResPathUtil.GetBgImgPath(tempRes[index]);
+            UI_bgItem.ProxyEnd();
+
+            item.data = tempRes[index];
+        }
+
+        private void OnClickBgListItem(EventContext context)
+        {
+            GObject listItem = context.data as GObject;
+            string res = (string)listItem.data;
+
+            ChangeBg(res);
+        }
+
+        private void OnClickBtnChange()
+        {
+            SceneController.bgTempRes = (string)_ui.m_bgList.GetChildAt(_ui.m_bgList.selectedIndex).data;
+            Hide();
+        }
+
+        private void ChangeBg(string res)
+        {
+            UI_MainUI mainUI = UI_MainUI.Proxy(_ui.m_mainUIShow);
+            mainUI.m_loaBg.url = ResPathUtil.GetBgImgPath(res);
+            UI_MainUI.ProxyEnd();
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/MainBgChooseView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 59ae6506c4d554144983df2f969cd9fe
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -53,6 +53,7 @@ namespace GFGGame
             RoleInfoManager.Instance.UpdateHead(_ui.m_comHead, _roleInfo.headId, _roleInfo.headBorderId);
 
             _roleDetailInfo = await RoleInfoSProxy.ReqOtherRoleDetailInfo(_roleInfo.roleId);
+            
             if (_roleDetailInfo != null)
             {
                 Timers.inst.StartCoroutine(PictureStorageHelper.Download(_roleDetailInfo.showPhotoList));

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/RoleInfoView.cs

@@ -72,7 +72,7 @@ namespace GFGGame
             }
 
             _ui.m_txtSlogan.text = RoleDataManager.slogan;
-            _ui.m_btnFieldGuide.title = string.Format("套装收集度:{0}%", RoleInfoManager.Instance.GetGuideProgress());
+            _ui.m_btnFieldGuide.title = string.Format("套装收集度:{0}%", RoleInfoManager.Instance.GetSuitGuideProgress());
             UpdateHead();
             UpdateList();
             UpdateRedDot();

+ 66 - 2
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/SettingView.cs

@@ -11,6 +11,8 @@ namespace GFGGame
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
 
+        private readonly float disabledVolumnSliderAlpha = 0.25f;
+
         public override void Dispose()
         {
             EffectUIPool.Recycle(_effectUI1);
@@ -39,6 +41,13 @@ namespace GFGGame
             _ui.m_btnLogout.onClick.Add(OnClickBtnLogout);
             _ui.m_btnSound.onClick.Add(OnClickBtnSound);
             _ui.m_btnMusic.onClick.Add(OnClickBtnMusic);
+            _ui.m_btnVoice.onClick.Add(OnClickBtnVoice);
+            _ui.m_btnChooseMainBg.onClick.Add(OnClickBtnChangeMainBg);
+
+            _ui.m_voiceSlider.onChanged.Add(OnChangeVoiceVolumn);
+            _ui.m_musicSlider.onChanged.Add(OnChangeMusicVolumn);
+            _ui.m_soundSlider.onChanged.Add(OnChangeSoundVolumn);
+
             AddEffect();
         }
 
@@ -46,8 +55,7 @@ namespace GFGGame
         {
             base.OnShown();
             AddEffect();
-            _ui.m_btnSound.selected = SoundManager.Instance.isOn;
-            _ui.m_btnMusic.selected = MusicManager.Instance.isOn;
+            InitVolumnSetting();
         }
 
         protected override void OnHide()
@@ -87,13 +95,69 @@ namespace GFGGame
         private void OnClickBtnSound()
         {
             SoundManager.Instance.isOn = _ui.m_btnSound.selected;
+            _ui.m_soundSlider.touchable = SoundManager.Instance.isOn;
+            _ui.m_soundSlider.alpha = SoundManager.Instance.isOn ? 1 : disabledVolumnSliderAlpha;
 
         }
 
         private void OnClickBtnMusic()
         {
             MusicManager.Instance.isOn = _ui.m_btnMusic.selected;
+            _ui.m_musicSlider.touchable = MusicManager.Instance.isOn;
+            _ui.m_musicSlider.alpha = MusicManager.Instance.isOn ? 1 : disabledVolumnSliderAlpha;
+        }
+
+        private void OnClickBtnVoice()
+        {
+            VoiceManager.Instance.isOn = _ui.m_btnVoice.selected;
+            _ui.m_voiceSlider.touchable = VoiceManager.Instance.isOn;
+            _ui.m_voiceSlider.alpha = VoiceManager.Instance.isOn ? 1 : disabledVolumnSliderAlpha;
+        }
+
+        private void OnChangeVoiceVolumn()
+        {
+            float volumn = (float)_ui.m_voiceSlider.value / 100;
+            VoiceManager.Instance.SetVolumn(volumn);
+            Debug.LogError(volumn);
+            LocalCache.SetFloat(LauncherConfig.VOICE_VOLUMN_KEY, volumn);
+        }
+
+        private void OnChangeMusicVolumn()
+        {
+            float volumn = (float)_ui.m_musicSlider.value / 100;
+            MusicManager.Instance.SetSettingVolumn(volumn);
+            MusicManager.Instance.SetVolume(volumn);
+            LocalCache.SetFloat(LauncherConfig.MUSIC_VOLUMN_KEY, volumn);
+        }
+
+        private void OnChangeSoundVolumn()
+        {
+            float volumn = (float)_ui.m_soundSlider.value / 100;
+            SoundManager.Instance.SetVolumn(volumn);
+            LocalCache.SetFloat(LauncherConfig.SOUND_VOLUMN_KEY, volumn);
+        }
+
+        private void OnClickBtnChangeMainBg()
+        {
+            ViewManager.Show<MainBgChooseView>();
+        }
+
+        private void InitVolumnSetting()
+        {
+            _ui.m_btnMusic.selected = MusicManager.Instance.isOn;
+            _ui.m_musicSlider.touchable = MusicManager.Instance.isOn;
+            _ui.m_musicSlider.alpha = MusicManager.Instance.isOn ? 1 : disabledVolumnSliderAlpha;
+            _ui.m_musicSlider.value = MusicManager.Instance.GetSettingVolumn() * 100;
+
+            _ui.m_btnSound.selected = SoundManager.Instance.isOn;
+            _ui.m_soundSlider.touchable = SoundManager.Instance.isOn;
+            _ui.m_soundSlider.alpha = SoundManager.Instance.isOn ? 1 : disabledVolumnSliderAlpha;
+            _ui.m_soundSlider.value = GRoot.inst.soundVolume * 100;
 
+            _ui.m_btnVoice.selected = VoiceManager.Instance.isOn;
+            _ui.m_voiceSlider.touchable = VoiceManager.Instance.isOn;
+            _ui.m_voiceSlider.alpha = VoiceManager.Instance.isOn ? 1 : disabledVolumnSliderAlpha;
+            _ui.m_voiceSlider.value = VoiceManager.Instance.GetVolumn() * 100;
         }
     }
 }

+ 6 - 0
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -15,6 +15,12 @@ namespace GFGGame
         public const int HTTP_POST_TIME_OUT = 15;
         public static string SOUND_KEY = "sound";
         public static string MUSIC_KEY = "music";
+        public static string VOICE_KEY = "voice";
+
+        public static string SOUND_VOLUMN_KEY = "sound_volumn";
+        public static string MUSIC_VOLUMN_KEY = "music_volumn";
+        public static string VOICE_VOLUMN_KEY = "voice_volumn";
+
         public const string SQL_FILE_NAME = "excelConfig.sqlite.bytes";
 
         public const string LAST_LOGIN_IS_AGREE_KEY = "LAST_LOGIN_IS_AGREE_KEY_6";//上次登录是否同意隐私政策

+ 12 - 2
GameClient/Assets/Game/Launcher/LocalCache/LocalCache.cs

@@ -6,17 +6,27 @@ namespace GFGGame
     {
         public static void SetBool(string key, bool isOn)
         {
-            int value = isOn?1:0;
+            int value = isOn ? 1 : 0;
             PlayerPrefs.SetInt(key, value);
             PlayerPrefs.Save();
         }
 
         public static bool GetBool(string key, bool defaultValue)
         {
-            int defaultInt = defaultValue?1:0;
+            int defaultInt = defaultValue ? 1 : 0;
             int value = PlayerPrefs.GetInt(key, defaultInt);
             return value > 0;
         }
 
+        public static void SetFloat(string key, float value)
+        {
+            PlayerPrefs.SetFloat(key, value);
+            PlayerPrefs.Save();
+        }
+
+        public static float GetFloat(string key, float defaultValue)
+        {
+            return PlayerPrefs.GetFloat(key, defaultValue);
+        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1.png


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


BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_atlas0.png


BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_fui.bytes