ソースを参照

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

# Conflicts:
#	GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs
guodong 1 年間 前
コミット
daf6c31dd4

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -7,7 +7,7 @@ namespace GFGGame
     public class LuckyBoxDataManager : SingletonBase<LuckyBoxDataManager>
     {
 
-        // public const int BOX_ID_1 = 1;
+        public const int BOX_ID_1 = 1;
         public const int BOX_ID_2 = 2;//常驻奖池2
         public const int BOX_ID_3 = 3;//常驻奖池2
 

+ 5 - 4
GameClient/Assets/Game/HotUpdate/Data/StoryDialogDataManager.cs

@@ -12,15 +12,16 @@ namespace GFGGame
             _waitBgChange = false;
         }
 
-        private bool _waitPicFade = false;
-        private bool _waitBgChange = false;
-        private float _dialogShowDelay = 0.0f;
-        private bool _waiting = false;
+        private bool _waitPicFade = false;          // 等待立绘加载
+        private bool _waitBgChange = false;         // 等待背景更换
+        private float _dialogShowDelay = 0.0f;      // 对话延迟出现
+        private bool _waiting = false;              // 全局等待,如等待对话框的播放动画结束,或者等待某些演出结束
 
         // Dialog wait pic's animation finished 
         public bool waitPicFade { get { return _waitPicFade; } set { _waitPicFade = value; } }
         public bool waitBgChange { get { return _waitBgChange; } set { _waitBgChange = value; } }
         public float dialogShowDelay { get { return _dialogShowDelay; } set { _dialogShowDelay = value; } }
+        
 
         public bool waiting { get { return _waiting; } set { _waiting = value; } }
     }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/ArenaSproxy.cs

@@ -396,7 +396,8 @@ namespace GFGGame
                 arenaTarget.RoleInfo.roleId = 0;
                 arenaTarget.RoleInfo.roleName = arenaTargetProto.RobotDressupInfo.Name;
                 arenaTarget.RoleInfo.roleLv = robotCfg.level;
-                arenaTarget.RoleInfo.headRes = string.IsNullOrEmpty(arenaTargetProto.RobotDressupInfo.RobotHead) ? "self" : arenaTargetProto.RobotDressupInfo.RobotHead;
+                //由于现在机器人头像就一个,所以这么改
+                arenaTarget.RoleInfo.headRes = robotCfg.targetResArr[0]; //string.IsNullOrEmpty(arenaTargetProto.RobotDressupInfo.RobotHead) ? "self" : arenaTargetProto.RobotDressupInfo.RobotHead;
             }
 
             arenaTarget.FightDatas.Clear();

+ 124 - 0
GameClient/Assets/Game/HotUpdate/Sound/VoiceManager.cs

@@ -0,0 +1,124 @@
+using UnityEngine;
+using FairyGUI;
+using GFGGame.Launcher;
+using YooAsset;
+using System.Collections;
+using System.Threading.Tasks;
+using System;
+
+namespace GFGGame
+{
+    public class VoiceManager : SingletonMonoBase<VoiceManager>
+    {
+        private AudioSource player;
+        private AssetOperationHandle handle;
+        private Coroutine coroutine;
+
+        private bool _isOn = true;
+        public bool isOn
+        {
+            get
+            {
+                return _isOn;
+            }
+            set
+            {
+                if (_isOn != value)
+                {
+                    _isOn = value;
+                    if (_isOn)
+                    {
+                        GRoot.inst.soundVolume = 1;
+                    }
+                    else
+                    {
+                        GRoot.inst.soundVolume = 0;
+                        Stop();
+                    }
+                    LocalCache.SetBool(LauncherConfig.SOUND_KEY, _isOn);
+                }
+            }
+        }
+
+        private void Awake()
+        {
+            player = this.gameObject.AddComponent<AudioSource>();
+            isOn = LocalCache.GetBool(LauncherConfig.SOUND_KEY, true);
+        }
+
+        public void LoadRes(string path)
+        {
+            if (!YooAssets.CheckResExist(path))
+            {
+                return;
+            }
+            handle = YooAssets.LoadAssetSync<AudioClip>(path);
+            player.clip = handle.AssetObject as AudioClip;
+        }
+
+        public void PlayVoice()
+        {
+            if(player.clip != null)
+            {
+                player.Play();
+            }
+        }
+
+        public void StopVoice()
+        {
+            player.Stop();
+        }
+
+        public int GetClipLength()
+        {
+            if (player.clip != null)
+            {
+                return (int)Mathf.Ceil(player.clip.length);
+            }
+            return 0;
+        }
+
+        public void PlayOneShotCroutine(string path, Action action = null)
+        {
+            if (coroutine != null)
+            {
+                StopCoroutine(coroutine);
+            }
+            handle?.Release();
+            if (_isOn)
+            {
+                if (YooAssets.CheckResExist(path))
+                {
+                    coroutine = StartCoroutine(PlayOneShot(path, action));
+                }
+                else
+                {
+                    action?.Invoke();
+                }
+            }
+        }
+
+        private IEnumerator PlayOneShot(string path, Action action = null)
+        {
+            //AudioClip clip = GFGAsset.Load<AudioClip>(path);
+            handle = YooAssets.LoadAssetAsync<AudioClip>(path);
+            yield return handle;
+            player.clip = handle.AssetObject as AudioClip;
+            player.Play();
+            WaitForSound(action);
+        }
+
+        public void Stop()
+        {
+            player.Stop();
+        }
+
+        // 音频播放完成的回调函数 
+        private async Task WaitForSound(Action action = null)
+        {
+            int milliseconds = (int)(player.clip.length * 1000);
+            await Task.Delay(milliseconds);
+            action?.Invoke();
+        }
+    }
+}

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

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

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

@@ -158,7 +158,7 @@ namespace GFGGame
                 iconRes = itemCfg.res;
                 id = itemCfg.id;
                 isSuit = false;
-                if (itemCfg.itemType == ConstItemType.DRESS_UP)
+                //if (itemCfg.itemType == ConstItemType.DRESS_UP)
                     rarity = itemCfg.rarity;
             }
 
@@ -166,7 +166,7 @@ namespace GFGGame
             // item.m_txtCount.text = _listItemDatas[index].num==1?"": string.Format("{0}", _listItemDatas[index].num);
             item.m_txtCount.text = string.Format("{0}", _listItemDatas[index].num);
             item.m_loaIcon.url = ResPathUtil.GetIconPath(iconRes, ext);
-            if(rarity > 0)
+            if (rarity > 0)
                 item.m_QualityType.selectedIndex = rarity - 1;
 
             RarityIconController.UpdateRarityIcon(item.m_loaRarity, id, false, isSuit);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -1487,7 +1487,7 @@ namespace GFGGame
             GuideController.TryGuide(_ui.m_btnAutoPlay, ConstGuideId.BUY_CLOTHING, 8, "勾选后,会自动进行比拼哦~~");
             GuideController.TryCompleteGuide(ConstGuideId.BUY_CLOTHING, 8);
 
-            GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这次换装需要获得别人的认可呢。");
+            GuideController.TryGuide(_ui.m_btnHint, ConstGuideId.FIGHT_TIPS, 1, "这里可以看看通关提示呢~");
             GuideController.TryCompleteGuide(ConstGuideId.FIGHT_TIPS, 1);
 
             GuideController.TryGuide(_ui.m_btnRecommend, ConstGuideId.AUTOPLAY_FIGHT, 1, "", -1, true, 0, true, true);//这个引导自动完成,测试中策划要求件推荐搭配引导提前,为避免意外,没有改引导表,而是直接吧推荐搭配加到买必须品的引导力,这个引导自动完成

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

@@ -41,7 +41,6 @@ namespace GFGGame
             _ui.m_suitType2Items.onClickItem.Add(OnClickListSuitType2Item);
             _ui.m_suitTypeList.onClick.Add(OnClickListSuitType);
             InitSuitGuideType();
-            UpdateItemsByType(1);
         }
         protected override void AddEventListener()
         {
@@ -51,6 +50,7 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            UpdateItemsByType(1);
             UpdateListSuitTypeRedDots();
             Timers.inst.StartCoroutine(UpdateRedDot());
         }
@@ -203,7 +203,7 @@ namespace GFGGame
 
         private void OnClickBtnBack()
         {
-            UpdateItemsByType(1);
+            _ui.m_c1.SetSelectedIndex(0);
             _ui.m_suitTypeItems.target.scrollPane.ScrollTop();
             ViewManager.GoBackFrom(typeof(SuitGuideView).FullName);
         }

+ 17 - 2
GameClient/Assets/Game/HotUpdate/Views/InstanceZones/InstanceZonesUIView.cs

@@ -53,12 +53,14 @@ namespace GFGGame
             _valueBarController.OnShown();
             CheckFunOpen();
             UpdateRedDot();
+            Timers.inst.AddUpdate(CheckGuide);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
             _valueBarController.OnHide();
+            Timers.inst.Remove(CheckGuide);
         }
 
         protected override void AddEventListener()
@@ -71,6 +73,18 @@ namespace GFGGame
             base.RemoveEventListener();
         }
 
+        private void CheckGuide(object param)
+        {
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.STUDIO_PORCELAIN) <= 0)
+            {
+                UpdateToCheckGuide(null);
+            }
+            else
+            {
+                Timers.inst.Remove(CheckGuide);
+            }
+        }
+
         private void UpdateRedDot()
         {
             _valueBarController.UpRead();
@@ -90,7 +104,7 @@ namespace GFGGame
 
         private void OnClickBtnBack()
         {
-            ViewManager.GoBackFrom(typeof(InstanceZonesUIView).FullName);
+            Hide();
         }
 
         private void OnClickBtnStudio()
@@ -132,7 +146,8 @@ namespace GFGGame
 
         protected override void UpdateToCheckGuide(object param)
         {
-            _ui.m_loaGuidestudio.visible = false;
+            if (!ViewManager.CheckIsTopView(this.viewCom)) return;
+            //_ui.m_loaGuidestudio.visible = false;
             GuideController.TryGuide(_ui.m_btnStudio.target, ConstGuideId.STUDIO_PORCELAIN, 3, "工作室开门啦,进去看看~");
             GuideController.TryGuide(_ui.m_btnStudio.target, ConstGuideId.STUDIO_FILING, 3, "工作室有新的任务啦。");
             GuideController.TryGuide(_ui.m_btnField.target, ConstGuideId.FIELD, 2, "外出进行历史考察,会有意想不到的收获哦。");

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnswerView.cs

@@ -88,6 +88,12 @@ namespace GFGGame
         {
             Hide();
             var roleTeapartyInfo = LeagueDataManager.Instance.RoleTeapartyInfo;
+            if (LeagueDataManager.Instance.TeaPartyStatus == LeagueTeaPartyStatus.NotOpen && roleTeapartyInfo.IsNoActDayEnterLeague)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("该活动暂未开启");
+                return;
+            }
+
             if (roleTeapartyInfo.IsQuitTeaParty && roleTeapartyInfo.LastOpenCfgId != 0 && roleTeapartyInfo.LastOpenCfgId == LeagueDataManager.Instance.TeaPartyId) {
                 PromptController.Instance.ShowFloatTextPrompt("该玩法不可以重复参加哦");
                 return;

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

@@ -49,7 +49,6 @@ namespace GFGGame
             _ui = UI_LoadingView.Create();
             this.viewCom = _ui.target;
             isfullScreen = true;
-            isReturnView = true;
             _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holder, "ui_dljm", "ui_dljm_jdt_tw");
 
         }

+ 3 - 1
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -120,7 +120,9 @@ namespace GFGGame
                 boxId = (int)this.viewData;
             }
 
-            if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0) boxId = LuckyBoxDataManager.BOX_ID_2;
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0) 
+                boxId = LuckyBoxDataManager.BOX_ID_1;
+
             LuckyBoxDataManager.Instance.currentBoxId = boxId;
 
             if (_activeBoxId > 0 || boxId == LuckyBoxDataManager.BOX_ID_2) Timers.inst.Add(1, 0, CheckTime);

+ 23 - 18
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -69,20 +69,15 @@ namespace GFGGame
             base.Dispose();
         }
 
-        protected override void Init()
+        protected override void OnInit()
         {
-            base.Init();
+            base.OnInit();
             packageName = UI_StoryDialogUI.PACKAGE_NAME;
             _ui = UI_StoryDialogUI.Create();
             viewCom = _ui.target;
             isfullScreen = true;
-            isReturnView = true;
-
-        }
 
-        protected override void OnInit()
-        {
-            base.OnInit();
+            isReturnView = true;
             _ui.m_dialogText.target.visible = false;
             _ui.m_dialogName.target.visible = false;
             _ui.m_dialogHead.target.visible = false;
@@ -147,18 +142,18 @@ namespace GFGGame
             if (_storyStartID == MainStoryDataManager.priorId)
             {
                 _ui.m_c1.selectedIndex = 1;
-                // _ui.m_btnAutoPlay.selected = true;
                 OnClickBtnAutoPlay();
                 _speedAutoPlay = 1;
                 FightDataManager.Instance.dialogSpeed = _speedAutoPlay;
             }
 
-            if (IsTeaParty) {
+            if (IsTeaParty)
+            {
                 _ui.m_c1.selectedIndex = 2;
             }
 
             _ui.m_btnBack.visible = InstanceZonesDataManager.CheckLevelPass(100001001);
-            
+
         }
 
         protected override void OnHide()
@@ -183,11 +178,9 @@ namespace GFGGame
 
         private void OnClickBtnBack()
         {
-             
-            ViewManager.Show<StoryChapterView>(MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(typeof(StoryChapterView).FullName), true);
-            this.Hide();
-            //ViewManager.GoBackFrom(typeof(StoryDialogView).FullName);
-            // Over(false);
+            //Hide();
+            //ViewManager.Show<StoryChapterView>(MainStoryDataManager.currentChapterCfgId, ViewManager.GetGoBackDatas(typeof(StoryChapterView).FullName), true);
+            Over(false);
         }
 
         private void OnClickBtnNext()
@@ -430,6 +423,11 @@ namespace GFGGame
             string roleName = storyDialogCfg.name;
             string headRes = storyDialogCfg.head;
             string headAniRes = storyDialogCfg.headAni;
+
+            VoiceManager.Instance.StopVoice();
+            // 如果配置了语音,读取语音
+            VoiceManager.Instance.LoadRes(ResPathUtil.GetCardSoundPath("111111111"));
+
             if (roleName == "self")
             {
                 roleName = RoleDataManager.roleName;
@@ -472,7 +470,6 @@ namespace GFGGame
                         {
                             _dressUpObjUI.dressUpObj.CancelAction(true);
                         }
-                        //_dressUpObjUI.dressUpObj.PutOnDressUpData(_dressUpObjUI.dressUpObj.DressUpDataClone(), new int[] { ConstDressUpItemType.SHOU_CHI_WU });
                     }
                     if (headAniCfg != null && headAniCfg.faceId > 0)
                     {
@@ -554,6 +551,7 @@ namespace GFGGame
             }
             _wordList = Regex.Split(words, "&&");
             _wordIndex = 0;
+
             _typingEffect = new TypingFadeEffectPro(_wordTextField);
             _typingEffect.typeFinishedAction = ShowCurrentWords;
 
@@ -596,7 +594,8 @@ namespace GFGGame
             _wordIndex++;
             if (_autoPlay)
             {
-                Timers.inst.Add(GameConst.NEXT_WORDS_INTERVAL_MAX / _speedAutoPlay, 1, ShowNextWords);
+                int interval = (int)Mathf.Max(VoiceManager.Instance.GetClipLength(), GameConst.NEXT_WORDS_INTERVAL_MAX / _speedAutoPlay);
+                Timers.inst.Add(interval, 1, ShowNextWords);
             }
         }
 
@@ -642,10 +641,16 @@ namespace GFGGame
             StartTyping();
         }
 
+        /// <summary>
+        /// 开启打字机显示
+        /// </summary>
         private void StartTyping()
         {
             _typingEffect.SetSpeed(_speedAutoPlay);
             _typingEffect.Start();
+
+            // 如果配置了语音,则播放语音
+            VoiceManager.Instance.PlayVoice();
         }
 
         private void StopTyping()

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

@@ -231,16 +231,12 @@ namespace GFGGame
 
         private void CheckDailySign()
         {
-            Log.Debug("zyq" + GameGlobal.isLogon);
             if (GameGlobal.isLogon)
             {
-                ET.Log.Debug("zyq" + GameGlobal.isLogon);
-                ET.Log.Debug("zyq" + ActivityDataManager.Instance.sevenDayLoginBonusStatusList.Count + ":::" + GuideDataManager.currentGuideId);
                 if (ActivityDataManager.Instance.CanGetSevenDayBonus() &&
                     GuideDataManager.currentGuideId <= 0)
                 {
                     ViewManager.Show<SevenDayLoginView>();
-
                 }
                 else if (RedDotDataManager.Instance.DailySignRed())
                 {

+ 15 - 3
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/ChangeHeadView.cs

@@ -2,6 +2,7 @@ using UI.RoleInfo;
 using System.Collections.Generic;
 using FairyGUI;
 using UI.CommonGame;
+using UnityEngine;
 
 namespace GFGGame
 {
@@ -51,9 +52,9 @@ namespace GFGGame
             RoleInfoManager.Instance.SortHeadDatas();
             RoleInfoManager.Instance.SortHeadBorderDatas();
             _headCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.HEAD, ConstItemSubType.ROLE_HEAD));
-            _headCfgs = SoreItemCfgDatas(_headCfgs);
+            _headCfgs = SortItemCfgDatas(_headCfgs);
             _headBorderCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.HEAD, ConstItemSubType.ROLE_HEADBORDER));
-            _headBorderCfgs = SoreItemCfgDatas(_headBorderCfgs);
+            _headBorderCfgs = SortItemCfgDatas(_headBorderCfgs);
             OnTabChange();
             // _ui.m_list.selectedIndex = 0;
             // _ui.m_listBorder.selectedIndex = 0;
@@ -102,6 +103,11 @@ namespace GFGGame
 
         private void RenderListItem(int index, GObject obj)
         {
+            if (index >= _headCfgs.Count)
+            {
+                return;
+            }
+
             int headId = _headCfgs[index].id;
             UI_ListHeadItem item = UI_ListHeadItem.Proxy(obj);
             item.m_loaIcon.url = ResPathUtil.GetHeadPath(_headCfgs[index].res);
@@ -118,8 +124,14 @@ namespace GFGGame
             item.target.data = headId;
             UI_ListHeadItem.ProxyEnd();
         }
+
         private void RenderListBorderItem(int index, GObject obj)
         {
+            if (index >= _headBorderCfgs.Count)
+            {
+                return;
+            }
+
             ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(RoleDataManager.headId);
             ItemCfg borderCfg = _headBorderCfgs[index];
             int headBorderId = borderCfg.id;
@@ -194,7 +206,7 @@ namespace GFGGame
                 _ui.m_txtDesc.text = headBorderCfg.desc;
             }
         }
-        private List<ItemCfg> SoreItemCfgDatas(List<ItemCfg> list)
+        private List<ItemCfg> SortItemCfgDatas(List<ItemCfg> list)
         {
             list.Sort((ItemCfg a, ItemCfg b) =>
             {

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

@@ -439,7 +439,10 @@ namespace GFGGame
                     ViewManager.Show<ClothingSyntheticView>(param, goBackDatas, false);
                     break;
                 case nameof(LuckyBoxView):
-                    ViewManager.Show<LuckyBoxView>(param[0], goBackDatas, false);
+                    if(param.Length > 0)
+                        ViewManager.Show<LuckyBoxView>(param[0], goBackDatas, false);
+                    else
+                        ViewManager.Show<LuckyBoxView>(null, goBackDatas, false);
                     break;
                 default:
                     ViewManager.Show($"GFGGame.{jumpId}", null, goBackDatas, hideOther, true);

BIN
GameClient/Assets/ResIn/UI/League/League_fui.bytes


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