| Main/Core/NetworkPackage/ServerPack/HA3_Function/HA350_tagMCTreasureResult.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/BoneField/AdsManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoBaseWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoCallCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoCallCell.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoCallWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoCallWin.cs.meta | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Gubao/GubaoTipWin.cs | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/HappyXB/HappyXBModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/System/Main/HomeWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| Main/Utility/ComponentExtersion.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Main/Core/NetworkPackage/ServerPack/HA3_Function/HA350_tagMCTreasureResult.cs
@@ -4,6 +4,9 @@ // A3 50 通知寻宝结果 #tagMCTreasureResult public class HA350_tagMCTreasureResult : GameNetPackBasic { public byte TreasureType; //寻宝类型 public byte TreasureIndex; //寻宝索引 public byte CostType; //消耗类型:0-默认仙玉;1-免费次数;2-寻宝道具 public byte AddMoneyType; // 本次寻宝增加的积分货币类型,可能为0 public ushort AddMoneyValue; // 本次寻宝增加的积分货币值,可能为0 public ushort AddTreasureLuck; // 本次寻宝增加的幸运值 @@ -15,6 +18,9 @@ } public override void ReadFromBytes (byte[] vBytes) { TransBytes (out TreasureType, vBytes, NetDataType.BYTE); TransBytes (out TreasureIndex, vBytes, NetDataType.BYTE); TransBytes (out CostType, vBytes, NetDataType.BYTE); TransBytes (out AddMoneyType, vBytes, NetDataType.BYTE); TransBytes (out AddMoneyValue, vBytes, NetDataType.WORD); TransBytes (out AddTreasureLuck, vBytes, NetDataType.WORD); Main/System/BoneField/AdsManager.cs
@@ -58,6 +58,10 @@ case 6: SendGetReward(ADID); break; case 5: GubaoManager.Instance.selectCallIndex = 0; SendGetReward(ADID); break; } } Main/System/Gubao/GubaoBaseWin.cs
@@ -5,16 +5,26 @@ /// </summary> public class GubaoBaseWin : OneLevelWin { [SerializeField] Transform bg; [SerializeField] Transform jbbg; protected override void OpenSubUIByTabIndex() { switch (functionOrder) { case 0: currentSubUI = UIManager.Instance.OpenWindow<GubaoListWin>(); jbbg.SetActive(false); bg.SetActive(true); break; case 1: // 充值界面 // currentSubUI = UIManager.Instance.OpenWindow<RechargeWin>(); currentSubUI = UIManager.Instance.OpenWindow<GubaoCallWin>(); jbbg.SetActive(true); bg.SetActive(false); break; case 2: currentSubUI = UIManager.Instance.OpenWindow<GubaoListWin>(); jbbg.SetActive(false); bg.SetActive(true); break; default: Debug.LogWarning("未知的标签索引: " + functionOrder); Main/System/Gubao/GubaoCallCell.cs
New file @@ -0,0 +1,140 @@ using System; using System.Collections.Generic; using Cysharp.Threading.Tasks; using UnityEngine; using UnityEngine.UI; // 鉴宝结果 public class GubaoCallCell : MonoBehaviour { [SerializeField] Image canImage; [SerializeField] RotationTween rotationTween; //摇一摇0.5秒后,停止动-裂开特效 - 配合消失 [SerializeField] UIEffectPlayer openEffect; //裂开特效 [SerializeField] UIEffectPlayer showEffect; //展示特效 [SerializeField] Image itemIcon; [SerializeField] Text itemName; [SerializeField] Text cntText; [SerializeField] Image pieceImg; [SerializeField] Transform outRect; //溢出 [SerializeField] Image newImg; // 勾选跳过的直接显示结果 public async UniTask Display(int index) { bool isSkip = LocalSave.GetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, false); if (HappyXBModel.Instance.xbResultDict.IsNullOrEmpty()) { return; } if (!HappyXBModel.Instance.xbResultDict.ContainsKey(index)) { return; } var result = HappyXBModel.Instance.xbResultDict[index]; var itemCfg = ItemConfig.Get(result.itemId); var gbCfg = GubaoConfig.Get(result.itemId); if (isSkip) { canImage.SetActive(false); rotationTween.Stop(); openEffect.Stop(); showEffect.PlayByArrIndex(Math.Max(itemCfg.ItemColor - 1, 0)); itemIcon.SetActive(true); itemName.SetActive(true); cntText.SetActive(true); itemIcon.SetItemSprite(result.itemId); itemIcon.SetNativeSize(); itemName.text = itemCfg.ItemName; itemName.color = UIHelper.GetFuncQualityColor(itemCfg.ItemColor); cntText.text = "x" + result.count.ToString(); if (gbCfg == null) { pieceImg.SetActive(false); newImg.SetActive(false); } else { pieceImg.SetActive(true); if (GubaoManager.Instance.IsActive(result.itemId)) { newImg.SetActive(false); } else if (VirtualPackManager.Instance.GetNoPackItemCount(result.itemId) < gbCfg.UnlockItemCnt) { newImg.SetActive(true); } else { newImg.SetActive(false); } } outRect.SetActive(result.isOut); return; } //动画顺序 : 罐子摇一摇0.5秒-停止动-裂开特效-罐子提前消失-展示特效 canImage.SetActive(true); //随机1-6 int random = UnityEngine.Random.Range(1, 7); canImage.SetSprite($"GubaoCan{random}"); canImage.SetNativeSize(); canImage.transform.localRotation = Quaternion.identity; itemIcon.SetActive(false); itemName.SetActive(false); cntText.SetActive(false); outRect.SetActive(false); newImg.SetActive(false); showEffect.Stop(); int delay = isSkip ? 0 : index * 100; // delay 毫秒 await UniTask.Delay(delay); rotationTween.Play(); await UniTask.Delay(300); rotationTween.Stop(); openEffect.Play(); await UniTask.Delay(200); canImage.SetActive(false); await UniTask.Delay(400); showEffect.PlayByArrIndex(Math.Max(itemCfg.ItemColor - 1, 0)); itemIcon.SetActive(true); itemName.SetActive(true); cntText.SetActive(true); itemIcon.SetItemSprite(result.itemId); itemIcon.SetNativeSize(); itemName.text = itemCfg.ItemName; itemName.color = UIHelper.GetFuncQualityColor(itemCfg.ItemColor); cntText.text = "x" + result.count.ToString(); if (gbCfg == null) { pieceImg.SetActive(false); newImg.SetActive(false); } else { pieceImg.SetActive(true); if (GubaoManager.Instance.IsActive(result.itemId)) { newImg.SetActive(false); } else if (VirtualPackManager.Instance.GetNoPackItemCount(result.itemId) < gbCfg.UnlockItemCnt) { newImg.SetActive(true); } else { newImg.SetActive(false); } } outRect.SetActive(result.isOut); } } Main/System/Gubao/GubaoCallCell.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: ebac9a00058b123499b54518466683ed MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Gubao/GubaoCallWin.cs
New file @@ -0,0 +1,274 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using Cysharp.Threading.Tasks; using UnityEngine; using UnityEngine.UI; /// <summary> /// 鉴宝 /// </summary> public class GubaoCallWin : UIBase { [SerializeField] OwnItemCell ownItemCell; [SerializeField] Toggle skipToggle; [SerializeField] Button call1Btn; [SerializeField] Image call1ItemIcon; [SerializeField] Text call1Text; [SerializeField] Text freeCDTime; [SerializeField] Button call10Btn; [SerializeField] Image call10ItemIcon; [SerializeField] Text call10Text; [SerializeField] Text callTip; [SerializeField] Button rateBtn; [SerializeField] Transform rateRect; [SerializeField] Text[] rateTexts; [SerializeField] Transform resultObj; //展示X秒结束可点击关闭 [SerializeField] Transform opObj; //操作区在结果展示过程会隐藏 [SerializeField] UIEffectPlayer roleModel; //待机,结果3种 // [SerializeField] Transform talkRect; //1.未鉴宝时随机 2.鉴宝过程消失 3.鉴宝结束对应不同对话 [SerializeField] Text talkText; [SerializeField] Button closeResultBtn; [SerializeField] GubaoCallCell oneResultCell; [SerializeField] GubaoCallCell[] tenResultCells; float showResultTime = 0; //动画开始 float showCD = 0; //动画结束需 单抽1秒,十连2秒;跳过也需要0.x秒展示时间(受update影响) protected override void InitComponent() { skipToggle.AddListener((value) => { LocalSave.SetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, value); }); ownItemCell.itemID = TreasureSetConfig.Get((int)HappXBTitle.Gubao).CostItemID; call1Btn.AddListener(SendGubaoCall); call10Btn.AddListener(() => { GubaoManager.Instance.selectCallIndex = 1; HappyXBModel.Instance.SendXBManyQuest((int)HappXBTitle.Gubao); }); rateBtn.AddListener(() => { rateRect.SetActive(true); }); ShowRate(); closeResultBtn.AddListener(() => { if (Time.time - showResultTime < showCD) { return; } opObj.SetActive(true); resultObj.SetActive(false); ShowVenderTalk(0); }); } protected override void OnPreOpen() { HappyXBModel.Instance.RefreshXBTypeInfoAct += Display; HappyXBModel.Instance.RefreshXBResultAct += ShowResult; GubaoManager.Instance.clickCallEvent += clickCallEvent; skipToggle.isOn = LocalSave.GetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, false); opObj.SetActive(true); resultObj.SetActive(false); ShowVenderTalk(0); Display(); } protected override void OnPreClose() { HappyXBModel.Instance.RefreshXBTypeInfoAct -= Display; HappyXBModel.Instance.RefreshXBResultAct -= ShowResult; GubaoManager.Instance.clickCallEvent -= clickCallEvent; } void ShowVenderTalk(int quality) { if (quality == 0) { var random = Random.Range(1, GubaoManager.Instance.maxIdleTalk + 1); talkText.text = Language.Get("GubaoIdleTalk" + random); roleModel.Play(0); } else { talkText.text = Language.Get("GubaoResultTalk" + quality); roleModel.Play(GubaoManager.Instance.emojiDict[quality]); } } public void Display() { var funcSet = TreasureSetConfig.Get((int)HappXBTitle.Gubao); var item = ItemConfig.Get(funcSet.CostItemID); var IconKey = item.IconKey; call1ItemIcon.SetOrgSprite(IconKey); call10ItemIcon.SetOrgSprite(IconKey); var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, funcSet.CostItemID); int todayFreeCount = HappyXBModel.Instance.GetFreeCountToday((int)HappXBTitle.Gubao); int dayMaxCount = HappyXBModel.Instance.GetDailyFreeCount((int)HappXBTitle.Gubao); if (todayFreeCount < dayMaxCount) { call1Text.text = Language.Get("L1100", Language.Get("L1127"), (dayMaxCount - todayFreeCount) + "/" + dayMaxCount); } else { call1Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[0] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[0].ToString())); } call10Text.text = Language.Get("L1100", item.ItemName, UIHelper.AppendColor(funcSet.CostItemCountList[1] > itemCount ? TextColType.Red : TextColType.LightWhite, funcSet.CostItemCountList[1].ToString())); RefreshFreeTime(); //再招募{0}次后必得{1}武将 List<int> qualityList = new List<int>(); var needCount = HappyXBModel.Instance.GetNextXBCountForBigAward((int)HappXBTitle.Gubao, out qualityList); List<string> qualityStrList = new List<string>(); for (int i = 0; i < qualityList.Count; i++) { qualityStrList.Add(UIHelper.AppendColor(qualityList[i], Language.Get("L1039", Language.Get("CommonQuality" + qualityList[i])))); } callTip.text = Language.Get("Gubao12", needCount, string.Join(Language.Get("L1130"), qualityStrList.ToArray())); } //每秒刷新免费CD的倒计时 float cdTime = 0; void LateUpdate() { //每秒触发一次 cdTime += Time.deltaTime; if (cdTime < 0.5) return; cdTime = 0; RefreshFreeTime(); if (resultObj.gameObject.activeSelf && !opObj.gameObject.activeSelf) { if (Time.time - showResultTime > showCD) { opObj.SetActive(true); ShowVenderTalk(GetResultQuality()); } } } int GetResultQuality() { if (HappyXBModel.Instance.xbResultDict.IsNullOrEmpty()) { return 0; } int quality = 0; foreach (var item in HappyXBModel.Instance.xbResultDict.Values) { int tmp = ItemConfig.Get(item.itemId).ItemColor; if (tmp > quality) { quality = tmp; } } return quality; } void RefreshFreeTime() { if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.Gubao)) { freeCDTime.SetActive(false); } else { freeCDTime.SetActive(true); freeCDTime.text = Language.Get("L1128", TimeUtility.SecondsToHMS(TimeUtility.GetTodayRemainSeconds())); } } void SendGubaoCall() { if (PackManager.Instance.GetEmptyGridCount(PackType.Item) <= 0) { SysNotifyMgr.Instance.ShowTip("GeRen_chenxin_676165", 2); return; } GubaoManager.Instance.selectCallIndex = 0; if (HappyXBModel.Instance.IsHaveFreeXB((int)HappXBTitle.Gubao)) { HappyXBModel.Instance.SendXBQuest((int)HappXBTitle.Gubao, 0, 1); } else { HappyXBModel.Instance.SendOneXBQuest((int)HappXBTitle.Gubao); } } void ShowResult() { showResultTime = Time.time; resultObj.SetActive(true); var isSkip = skipToggle.isOn; showCD = isSkip ? 0.1f : GubaoManager.Instance.selectCallIndex == 0 ? 1f : 2f; if (GubaoManager.Instance.selectCallIndex == 0) { oneResultCell.SetActive(true); oneResultCell.Display(0).Forget(); for (int i = 0; i < tenResultCells.Length; i++) { tenResultCells[i].SetActive(false); } } else { oneResultCell.SetActive(false); for (int i = 0; i < tenResultCells.Length; i++) { tenResultCells[i].SetActive(true); tenResultCells[i].Display(i).Forget(); } } if (isSkip) { ShowVenderTalk(GetResultQuality()); } } void clickCallEvent() { if (!skipToggle.isOn) { showResultTime = Time.time + 2; //预设延迟2秒等服务端 opObj.SetActive(false); } } void ShowRate() { var config = HappyXBModel.Instance.GetXBItemConfigByType((int)HappXBTitle.Gubao); for (int i = 0; i < config.GridItemRateList1.Length; i++) { //减去上一个从差值才是概率 if (i == 0) { //小数点2位 rateTexts[i].text = (config.GridItemRateList1[i][0]/100.0).ToString("0.00") + "%"; } else { rateTexts[i].text = ((config.GridItemRateList1[i][0] - config.GridItemRateList1[i - 1][0])/100.0).ToString("0.00") + "%"; } } } } Main/System/Gubao/GubaoCallWin.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: adfce0ce10dd1f641866ff3f91cafbfa MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Gubao/GubaoManager.cs
@@ -32,6 +32,10 @@ //按 全部 升级 升星 区分 public Dictionary<int, List<int>> gubaoCollectDict = new Dictionary<int, List<int>>(); //古宝图鉴按品质列表 public const string skipKey = "SkipGBCall"; public Dictionary<int, int> emojiDict = new Dictionary<int, int>(); //品质:emojiID顺序 public int maxIdleTalk = 0; public override void Init() { @@ -54,6 +58,9 @@ void ParseConfig() { var config = FuncConfigConfig.Get("Gubao1"); emojiDict = ConfigParse.ParseIntDict(config.Numerical1); maxIdleTalk = int.Parse(config.Numerical2); } @@ -505,6 +512,22 @@ #endregion #region 鉴宝 public event Action clickCallEvent; int m_selectCallIndex = 0;//0:1抽 1:10抽 对应配置顺序 public int selectCallIndex { get { return m_selectCallIndex; } set { m_selectCallIndex = value; clickCallEvent?.Invoke(); } } #endregion #region 红点 Redpoint tmpRP = new Redpoint(MainRedDot.MainAffairsRedpoint, MainRedDot.RedPoint_GuaBao); Redpoint gubaoRP = new Redpoint(MainRedDot.RedPoint_GuaBao, MainRedDot.RedPoint_GuaBao * 10 + 1); //古宝 和 全部 @@ -514,7 +537,8 @@ Redpoint gubaoLVRP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 1, MainRedDot.RedPoint_GuaBao * 100 + 1); //升级 Redpoint gubaoStarRP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 1, MainRedDot.RedPoint_GuaBao * 100 + 2); //升星 Redpoint gbCall1RP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 2, (MainRedDot.RedPoint_GuaBao * 10 + 2) * 10 + 1); //1抽 Redpoint gbCall10RP = new Redpoint(MainRedDot.RedPoint_GuaBao * 10 + 2, (MainRedDot.RedPoint_GuaBao * 10 + 2) * 10 + 2); //10抽 public void UpdateRedpoint() { activeRP.state = RedPointState.None; Main/System/Gubao/GubaoTipWin.cs
Main/System/HappyXB/HappyXBModel.cs
@@ -135,6 +135,7 @@ public Dictionary<int, XBGetItem> xbResultDict { get; private set; } = new Dictionary<int, XBGetItem>(); //奖品顺序:奖品 public void GetServerXBResult(HA350_tagMCTreasureResult result) { int type = result.TreasureType; xbResultDict.Clear(); addXBScore = result.AddMoneyValue; addXBScoreType = result.AddMoneyType; @@ -149,8 +150,9 @@ int index = int.Parse(resultData[i][0].ToString()); int itemId = int.Parse(resultData[i][1].ToString()); int count = int.Parse(resultData[i][2].ToString()); bool isOut = int.Parse(resultData[i][3].ToString()) == 1; XBGetItem getItem = new XBGetItem(); getItem.SetModel(index, itemId, count); getItem.SetModel(index, itemId, count, isOut); if (!xbResultDict.ContainsKey(i)) { xbResultDict.Add(i, getItem); @@ -167,9 +169,14 @@ { RefreshXBResultAct(); } //武将招募结果是独立界面;古宝是同一个界面用RefreshXBResultAct处理 if (type == (int)HappXBTitle.HeroCallAdvanced) { if (!UIManager.Instance.IsOpened<HeroCallResultWin>()) { UIManager.Instance.OpenWindow<HeroCallResultWin>(); } } } @@ -710,13 +717,15 @@ public int gridIndex; public int itemId; public int count; public bool isOut; //是否溢出 public DateTime createTime; public void SetModel(int index, int id, int count) public void SetModel(int index, int id, int count, bool isOut) { this.gridIndex = index; this.itemId = id; this.count = count; this.isOut = isOut; createTime = TimeUtility.ServerNow; } } @@ -728,13 +737,11 @@ //Store = 3, //Warehouse = 4, GatherSoul = 4, //聚魂寻宝 Gubao1 = 5, Gubao2 = 6, Gubao3 = 7, Gubao4 = 8, HeroCallNormal = 11, //11-普通招募 Gubao = 5, HeroCallNormal = 11, //11-普通招募 -暂无 HeroCallAdvanced = 12, //12-高级招募 HeroCallScore = 13, //13-积分招募 HeroCallScore = 13, //13-积分招募 -暂无 YunShi1 = 105, YunShi2 = 106, YunShi3 = 107, Main/System/Main/HomeWin.cs
@@ -586,9 +586,7 @@ { taskEffect.Stop(); } var config = ItemConfig.Get(taskConfig.AwardItemList[0][0]); awardIcon.SetOrgSprite(ItemConfig.Get(taskConfig.AwardItemList[0][0]).IconKey, GeneralDefine.itemIconDict.ContainsKey(config.Type) ? GeneralDefine.itemIconDict[config.Type] : "icon"); awardIcon.SetItemSprite(taskConfig.AwardItemList[0][0]); awardCnt.text = taskConfig.AwardItemList[0][1].ToString(); } } Main/Utility/ComponentExtersion.cs
@@ -389,8 +389,9 @@ return; } var sprite = UILoader.LoadSprite("icon", itemConfig.IconKey); _image.overrideSprite = sprite; _image.SetOrgSprite(itemConfig.IconKey, GeneralDefine.itemIconDict.ContainsKey(itemConfig.Type) ? GeneralDefine.itemIconDict[itemConfig.Type] : "icon"); } public static void SetSkillSprite(this Image _image, int skillID)