From d21ab089026bfe22df1e5c36ef2d66554957c188 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 26 九月 2025 18:09:51 +0800
Subject: [PATCH] 197 子 【内政】淘金系统 / 【内政】淘金系统-客户端
---
Main/System/InternalAffairs/AffairFuncCell.cs.meta | 11
Main/System/HeroUI/HeroModel.cs | 19
Main/Component/UI/Common/CountControler.cs | 106 ++
Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs | 35
Main/System/InternalAffairs/GoldRushLeader.cs | 201 ++++
Main/System/Battle/BattleField/StoryBattleField.cs | 2
Main/System/InternalAffairs/GoldRushRefreshWin.cs.meta | 11
Main/System/Redpoint/MainRedDot.cs | 6
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs.meta | 11
Main/System/InternalAffairs/GoldRushWorkerCell.cs.meta | 11
Main/System/InternalAffairs/GoldRushManager.cs.meta | 11
Main/Component/UI/Common/GroupButtonEx.cs | 1
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs | 13
Main/System/Tip/ConfirmCancel.cs | 66
Main/Utility/EnumHelper.cs | 7
Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs | 29
Main/System/InternalAffairs/AffairBaseWin.cs | 108 ++
Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs.meta | 11
Main/System/InternalAffairs/GoldRushPosEvent.cs | 31
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs.meta | 11
Main/System/InternalAffairs/GoldRushWorkCell.cs.meta | 11
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs | 20
Main/Config/Configs/GoldRushItemConfig.cs | 53 +
Main/Config/Configs/GoldRushWorkerConfig.cs | 62 +
Main/System/InternalAffairs/GoldRushRefreshWin.cs | 270 +++++
Main/System/Tip/MoneyIconToggleConfirmWin.cs.meta | 11
Main/System/InternalAffairs/GoldRushPosEvent.cs.meta | 11
Main/System/InternalAffairs/GoldRushLeader.cs.meta | 11
Main/Config/Configs/GoldRushCampConfig.cs | 56 +
Main/Config/Configs/GoldRushCampConfig.cs.meta | 11
Main/Utility/TimeUtility.cs | 2
Main/Config/ConfigManager.cs | 9
Main/System/InternalAffairs/AffairFuncCell.cs | 53 +
Main/Core/NetworkPackage/ServerPack/HB0_Event.meta | 8
Main/System/InternalAffairs/GoldRushTentCell.cs | 578 +++++++++++
Main/System/KnapSack/Logic/ItemLogicUtility.cs | 27
Main/System/InternalAffairs/GoldRushTentCell.cs.meta | 11
Main/Component/UI/Common/CountControler.cs.meta | 11
Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs | 13
Main/System/InternalAffairs/GoldRushWorkCell.cs | 18
Main/Main.cs | 1
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs | 16
Main/System/InternalAffairs/GoldRushManager.cs | 524 ++++++++++
Main/Config/ConfigParse.cs | 1
Main/System/Main/AutoFightModel.cs | 2
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs | 20
Main/System/Hero/UIHeroController.cs | 71 +
Main/System/Tip/ToggleConfirmWin.cs | 11
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs | 22
Main/System/InternalAffairs/GoldRushWorkerWin.cs | 94 +
Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta | 8
Main/System/ItemTip/ItemTipUtility.cs | 4
Main/System/InternalAffairs/GoldRushWorkerWin.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs.meta | 11
Main/Utility/UIHelper.cs | 39
Main/Core/NetworkPackage/ClientPack/CB0_Event.meta | 8
Main/System/Tip/MoneyIconToggleConfirmWin.cs | 71 +
Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs.meta | 11
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 2
Main/Config/Configs/GoldRushWorkerConfig.cs.meta | 11
Main/Config/Configs/GoldRushItemConfig.cs.meta | 11
Main/System/HeroUI/HeroModel.cs.meta | 11
Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs.meta | 11
Main/System/InternalAffairs/GoldRushWorkerCell.cs | 14
66 files changed, 2,852 insertions(+), 102 deletions(-)
diff --git a/Main/Component/UI/Common/CountControler.cs b/Main/Component/UI/Common/CountControler.cs
new file mode 100644
index 0000000..b5e69aa
--- /dev/null
+++ b/Main/Component/UI/Common/CountControler.cs
@@ -0,0 +1,106 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using System;
+
+/// <summary>
+/// 甯︽湁+-鎸夐挳鎺у埗鏁伴噺鏄剧ず鍜屽洖璋�
+/// </summary>
+public class CountControler : MonoBehaviour
+{
+ [SerializeField] Text countText;
+ [SerializeField] LongPressButton addBtn;
+ [SerializeField] LongPressButton decBtn;
+
+ int count; //褰撳墠鏁伴噺
+ int maxCount; //鏈�澶ф暟閲�
+
+ Action<int> OnChangeEvent;
+ Func<int, bool> CanAddEvent;
+ Func<int, bool> CanDecEvent;
+ void Start()
+ {
+ addBtn.AddListener(() =>
+ {
+ if (CanAddEvent == null || !CanAddEvent(count))
+ {
+ return;
+ }
+ count++;
+ Refresh();
+ });
+ addBtn.onPress.AddListener(() =>
+ {
+ if (CanAddEvent == null || !CanAddEvent(count))
+ {
+ return;
+ }
+ count++;
+ Refresh();
+ });
+ decBtn.AddListener(() =>
+ {
+ if (CanDecEvent == null || !CanDecEvent(count))
+ {
+ return;
+ }
+ count--;
+ Refresh();
+ });
+ decBtn.onPress.AddListener(() =>
+ {
+ if (CanDecEvent == null || !CanDecEvent(count))
+ {
+ return;
+ }
+ count--;
+ Refresh();
+ });
+
+ }
+
+ public void Init(Action<int> _OnChangeEvent, int _maxCount, int _count = 1, Func<int, bool> _CanAddEvent = null, Func<int, bool> _CanDecEvent = null)
+ {
+ count = _count;
+ maxCount = _maxCount;
+ OnChangeEvent = _OnChangeEvent;
+ CanAddEvent = _CanAddEvent;
+ CanDecEvent = _CanDecEvent;
+
+ Refresh();
+
+ }
+
+ void Refresh()
+ {
+
+ if (count >= maxCount)
+ {
+ count = maxCount;
+ addBtn.interactable = false;
+ addBtn.SetColorful(null, false);
+ }
+ else
+ {
+ addBtn.interactable = true;
+ addBtn.SetColorful(null, true);
+ }
+
+ if (count <= 0)
+ {
+ count = 0;
+ decBtn.interactable = false;
+ decBtn.SetColorful(null, false);
+ }
+ else
+ {
+ decBtn.interactable = true;
+ decBtn.SetColorful(null, true);
+ }
+
+ countText.text = count + "/" + maxCount;
+ OnChangeEvent?.Invoke(count);
+ }
+
+}
diff --git a/Main/Component/UI/Common/CountControler.cs.meta b/Main/Component/UI/Common/CountControler.cs.meta
new file mode 100644
index 0000000..217985c
--- /dev/null
+++ b/Main/Component/UI/Common/CountControler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f983682626e85224c9d1ec567cdfadf1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Component/UI/Common/GroupButtonEx.cs b/Main/Component/UI/Common/GroupButtonEx.cs
index f56f99a..6886535 100644
--- a/Main/Component/UI/Common/GroupButtonEx.cs
+++ b/Main/Component/UI/Common/GroupButtonEx.cs
@@ -10,6 +10,7 @@
//鍏宠仈鎸夐挳锛屽叾涓竴涓寒璧凤紝鍏朵粬鎸変笅锛屾枃瀛楅鑹插搴斿彉鏇�
//鏁版嵁鏇存柊閫氳繃SelectBtn鏇存柊 鎴栬�� GroupButtonExManager.SelectButton
+//浣跨敤姝ラ 1.搴忓垪鍖朑roupButtonEx绫诲瀷鐨勬寜閽紝2锛氬垵濮嬮渶璁剧疆SelectBtn()閫変腑鍝釜鎸夐挳锛屽叾浠栧拰鎸夐挳浣跨敤鏂规硶涓�鑷�
public class GroupButtonEx : ButtonEx
{
[SerializeField] GroupButtonExManager m_Manager; // 鎸夐挳缁勭鐞嗗櫒寮曠敤
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index 3c07753..26bfb54 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -44,6 +44,9 @@
typeof(DirtyWordConfig),
typeof(FaceConfig),
typeof(FightPowerRatioConfig),
+ typeof(GoldRushCampConfig),
+ typeof(GoldRushItemConfig),
+ typeof(GoldRushWorkerConfig),
typeof(HeroLineupHaloConfig),
typeof(HeroQualityLVConfig),
typeof(InvestConfig),
@@ -226,6 +229,12 @@
ClearConfigDictionary<FaceConfig>();
// 娓呯┖ FightPowerRatioConfig 瀛楀吀
ClearConfigDictionary<FightPowerRatioConfig>();
+ // 娓呯┖ GoldRushCampConfig 瀛楀吀
+ ClearConfigDictionary<GoldRushCampConfig>();
+ // 娓呯┖ GoldRushItemConfig 瀛楀吀
+ ClearConfigDictionary<GoldRushItemConfig>();
+ // 娓呯┖ GoldRushWorkerConfig 瀛楀吀
+ ClearConfigDictionary<GoldRushWorkerConfig>();
// 娓呯┖ HeroLineupHaloConfig 瀛楀吀
ClearConfigDictionary<HeroLineupHaloConfig>();
// 娓呯┖ HeroQualityLVConfig 瀛楀吀
diff --git a/Main/Config/ConfigParse.cs b/Main/Config/ConfigParse.cs
index 1d7e066..c1461f7 100644
--- a/Main/Config/ConfigParse.cs
+++ b/Main/Config/ConfigParse.cs
@@ -62,6 +62,7 @@
return string.Empty;
}
+ //涓�缁存暟缁勶細鏉ユ簮鏍煎紡濡� 1|2|3|4
public static T[] GetMultipleStr<T>(string msg) where T : struct
{
string[] segs = GetMultipleStr(msg);
diff --git a/Main/Config/Configs/GoldRushCampConfig.cs b/Main/Config/Configs/GoldRushCampConfig.cs
new file mode 100644
index 0000000..06d8f9b
--- /dev/null
+++ b/Main/Config/Configs/GoldRushCampConfig.cs
@@ -0,0 +1,56 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�9鏈�22鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class GoldRushCampConfig : ConfigBase<int, GoldRushCampConfig>
+{
+ static GoldRushCampConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int CampID;
+ public int PanningUnlock;
+ public int[] MoneyUnlock;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out CampID);
+
+ int.TryParse(tables[1],out PanningUnlock);
+
+ if (tables[2].Contains("["))
+ {
+ MoneyUnlock = JsonMapper.ToObject<int[]>(tables[2]);
+ }
+ else
+ {
+ string[] MoneyUnlockStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ MoneyUnlock = new int[MoneyUnlockStringArray.Length];
+ for (int i=0;i<MoneyUnlockStringArray.Length;i++)
+ {
+ int.TryParse(MoneyUnlockStringArray[i],out MoneyUnlock[i]);
+ }
+ }
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/GoldRushCampConfig.cs.meta b/Main/Config/Configs/GoldRushCampConfig.cs.meta
new file mode 100644
index 0000000..5953241
--- /dev/null
+++ b/Main/Config/Configs/GoldRushCampConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bdc47c65f607d5f41aad27a9507f9e82
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/GoldRushItemConfig.cs b/Main/Config/Configs/GoldRushItemConfig.cs
new file mode 100644
index 0000000..6cca396
--- /dev/null
+++ b/Main/Config/Configs/GoldRushItemConfig.cs
@@ -0,0 +1,53 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�9鏈�22鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class GoldRushItemConfig : ConfigBase<int, GoldRushItemConfig>
+{
+ static GoldRushItemConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int GoldID;
+ public int ItemID;
+ public int ItemLV;
+ public int ItemCount;
+ public int WorkerMax;
+ public int NeedSeconds;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out GoldID);
+
+ int.TryParse(tables[1],out ItemID);
+
+ int.TryParse(tables[2],out ItemLV);
+
+ int.TryParse(tables[3],out ItemCount);
+
+ int.TryParse(tables[4],out WorkerMax);
+
+ int.TryParse(tables[5],out NeedSeconds);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/GoldRushItemConfig.cs.meta b/Main/Config/Configs/GoldRushItemConfig.cs.meta
new file mode 100644
index 0000000..9ba11b3
--- /dev/null
+++ b/Main/Config/Configs/GoldRushItemConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 72f509bb5c2d2eb4a8e9325e52dc2ea7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/Configs/GoldRushWorkerConfig.cs b/Main/Config/Configs/GoldRushWorkerConfig.cs
new file mode 100644
index 0000000..7fef9e2
--- /dev/null
+++ b/Main/Config/Configs/GoldRushWorkerConfig.cs
@@ -0,0 +1,62 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Monday, September 22, 2025
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class GoldRushWorkerConfig : ConfigBase<int, GoldRushWorkerConfig>
+{
+ static GoldRushWorkerConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int WorkerID;
+ public string Name;
+ public int PlayerLVUnlock;
+ public int[] MoneyUnlock;
+ public int SkinID;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out WorkerID);
+
+ Name = tables[1];
+
+ int.TryParse(tables[2],out PlayerLVUnlock);
+
+ if (tables[3].Contains("["))
+ {
+ MoneyUnlock = JsonMapper.ToObject<int[]>(tables[3]);
+ }
+ else
+ {
+ string[] MoneyUnlockStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ MoneyUnlock = new int[MoneyUnlockStringArray.Length];
+ for (int i=0;i<MoneyUnlockStringArray.Length;i++)
+ {
+ int.TryParse(MoneyUnlockStringArray[i],out MoneyUnlock[i]);
+ }
+ }
+
+ int.TryParse(tables[4],out SkinID);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/GoldRushWorkerConfig.cs.meta b/Main/Config/Configs/GoldRushWorkerConfig.cs.meta
new file mode 100644
index 0000000..812cec8
--- /dev/null
+++ b/Main/Config/Configs/GoldRushWorkerConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8e91e6e26f681b74aacc2e21d5624b0e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event.meta b/Main/Core/NetworkPackage/ClientPack/CB0_Event.meta
new file mode 100644
index 0000000..b65c271
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0e42d9937d892ef4380d5873498135e5
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs
new file mode 100644
index 0000000..fd1f3de
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs
@@ -0,0 +1,22 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 36 娣橀噾鎿嶄綔 #tagCSGoldRushOP
+
+public class CB036_tagCSGoldRushOP : GameNetPackBasic {
+ public byte OPType; // 0-鎺ュ彈娣橀噾锛�1-鍒锋柊娣橀噾锛�2-寮�濮嬫窐閲戞垨璋冩暣鐩戝伐鏁帮紱3-鍙栨秷娣橀噾
+ public byte CampID; // 钀ュ湴ID
+ public byte WorkerCnt; // 娲鹃仯鐩戝伐鏁帮紝浠呯被鍨�2鏈夋晥
+
+ public CB036_tagCSGoldRushOP () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB036;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (OPType, NetDataType.BYTE);
+ WriteBytes (CampID, NetDataType.BYTE);
+ WriteBytes (WorkerCnt, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs.meta
new file mode 100644
index 0000000..7a5e091
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB036_tagCSGoldRushOP.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 296895007a9ba9d4a87849c7cd6bb975
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs
new file mode 100644
index 0000000..7c83606
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 37 娣橀噾瑙i攣 #tagCSGoldRushUnlock
+
+public class CB037_tagCSGoldRushUnlock : GameNetPackBasic {
+ public byte UnlockType; // 0-钀ュ湴锛�1-鐩戝伐
+ public byte UnlockID; // 瑙i攣绫诲瀷瀵瑰簲鐨処D
+
+ public CB037_tagCSGoldRushUnlock () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB037;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (UnlockType, NetDataType.BYTE);
+ WriteBytes (UnlockID, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs.meta
new file mode 100644
index 0000000..c1ced9e
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB037_tagCSGoldRushUnlock.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fb441d2b380f8e74ab36cbd2a00771f3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs
new file mode 100644
index 0000000..7598da0
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 38 娣橀噾浠撳簱棰嗗 #tagCSGoldRushWarehouseAward
+
+public class CB038_tagCSGoldRushWarehouseAward : GameNetPackBasic {
+ public byte AwardIndex; // 棰嗗浣嶇疆绱㈠紩锛屼粠0寮�濮�
+ public byte IsAll; // 鏄惁棰嗗彇鎵�鏈�
+
+ public CB038_tagCSGoldRushWarehouseAward () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB038;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (AwardIndex, NetDataType.BYTE);
+ WriteBytes (IsAll, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs.meta
new file mode 100644
index 0000000..a2aa80b
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB038_tagCSGoldRushWarehouseAward.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7fb3ef2247d90a449a9071ad0231ab19
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs
new file mode 100644
index 0000000..a059f59
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs
@@ -0,0 +1,16 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 39 鑷姩娣橀噾鍏嶈垂浣跨敤 #tagCSGoldRushAutoFreeUse
+
+public class CB039_tagCSGoldRushAutoFreeUse : GameNetPackBasic {
+
+ public CB039_tagCSGoldRushAutoFreeUse () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xB039;
+ }
+
+ public override void WriteToBytes () {
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs.meta b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs.meta
new file mode 100644
index 0000000..34f8295
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CB0_Event/CB039_tagCSGoldRushAutoFreeUse.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 00d1fb82f8071ab468b880ac99112f64
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
new file mode 100644
index 0000000..14855bf
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 26d5b9bf2617a8c4eab5a7b44fff8a6b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs
new file mode 100644
index 0000000..9587b4c
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 36 娣橀噾鐩稿叧淇℃伅 #tagSCGoldRushInfo
+
+public class DTCB036_tagSCGoldRushInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HB036_tagSCGoldRushInfo vNetData = vNetPack as HB036_tagSCGoldRushInfo;
+ GoldRushManager.Instance.UpdateGoldRushInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs.meta
new file mode 100644
index 0000000..61240f0
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB036_tagSCGoldRushInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b7d45ed4800426541a0890be19402c89
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs
new file mode 100644
index 0000000..a0e445f
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 37 娣橀噾钀ュ湴淇℃伅 #tagSCGoldRushCampInfo
+
+public class DTCB037_tagSCGoldRushCampInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HB037_tagSCGoldRushCampInfo vNetData = vNetPack as HB037_tagSCGoldRushCampInfo;
+ GoldRushManager.Instance.UpdateGoldRushCampInfo(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs.meta
new file mode 100644
index 0000000..4803ed5
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB0_Event/DTCB037_tagSCGoldRushCampInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ac641383195ddde4dba05a8dbe123aac
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index b6dd785..5c63f60 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -114,6 +114,8 @@
Register(typeof(HA720_tagMCCreateRoleAwardState), typeof(DTCA720_tagMCCreateRoleAwardState));
Register(typeof(HB405_tagMCAddExp), typeof(DTCB405_tagMCAddExp));
Register(typeof(HB123_tagSCDropBootyInfo), typeof(DTCB123_tagSCDropBootyInfo));
+ Register(typeof(HB036_tagSCGoldRushInfo), typeof(DTCB036_tagSCGoldRushInfo));
+ Register(typeof(HB037_tagSCGoldRushCampInfo), typeof(DTCB037_tagSCGoldRushCampInfo));
}
//涓诲伐绋嬫敞鍐屽皝鍖�
diff --git a/Main/Core/NetworkPackage/ServerPack/HB0_Event.meta b/Main/Core/NetworkPackage/ServerPack/HB0_Event.meta
new file mode 100644
index 0000000..e380b3a
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB0_Event.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f805cb72dad807b4ab0ec9f876f78075
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs
new file mode 100644
index 0000000..552f61b
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 36 娣橀噾鐩稿叧淇℃伅 #tagSCGoldRushInfo
+
+public class HB036_tagSCGoldRushInfo : GameNetPackBasic {
+ public uint CampState; // 宸茶В閿佽惀鍦扮姸鎬侊紝鎸夎惀鍦癐D浜岃繘鍒朵綅杩愮畻鍒ゆ柇鏄惁宸茶В閿�
+ public uint WorkerState; // 宸查泧浣e伐浜虹姸鎬侊紝鎸夊伐浜篒D浜岃繘鍒朵綅杩愮畻鍒ゆ柇鏄惁宸茶В閿�
+ public uint PanningCnt; // 绱娣橀噾娆℃暟
+ public uint LastRecoverTime; // 涓婃鍏嶈垂鎭㈠娣橀噾浠ゆ椂闂存埑锛屼负0鏃跺彲涓嶇敤鍊掕鏃�
+ public uint HousekeeperEndTime; // 鑷姩绠″鍒版湡鏃堕棿鎴筹紝鏈夊�煎悓鏃朵篃浠h〃鍏嶈垂璇曠敤宸蹭娇鐢�
+ public byte WarehouseCnt; // 娣橀噾浠撳簱鐗╁搧鏁�
+ public byte[] WarehouseIDList; // 娣橀噾浠撳簱宸插畬鎴愭窐閲慖D鍒楄〃 [绱㈠紩0娣橀噾ID, ...]锛屾窐閲慖D涓�0浠h〃璇ョ储寮曚綅缃负绌�
+
+ public HB036_tagSCGoldRushInfo () {
+ _cmd = (ushort)0xB036;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out CampState, vBytes, NetDataType.DWORD);
+ TransBytes (out WorkerState, vBytes, NetDataType.DWORD);
+ TransBytes (out PanningCnt, vBytes, NetDataType.DWORD);
+ TransBytes (out LastRecoverTime, vBytes, NetDataType.DWORD);
+ TransBytes (out HousekeeperEndTime, vBytes, NetDataType.DWORD);
+ TransBytes (out WarehouseCnt, vBytes, NetDataType.BYTE);
+ TransBytes (out WarehouseIDList, vBytes, NetDataType.BYTE, WarehouseCnt);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs.meta
new file mode 100644
index 0000000..e655fca
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB036_tagSCGoldRushInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fa2673764a1c61c4ba9c159c1c55b3dd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs
new file mode 100644
index 0000000..1e49fd4
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections;
+
+// B0 37 娣橀噾钀ュ湴淇℃伅 #tagSCGoldRushCampInfo
+
+public class HB037_tagSCGoldRushCampInfo : GameNetPackBasic {
+ public byte CampCnt;
+ public tagSCGoldRushCamp[] CampList; // 钀ュ湴鍒楄〃
+
+ public HB037_tagSCGoldRushCampInfo () {
+ _cmd = (ushort)0xB037;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out CampCnt, vBytes, NetDataType.BYTE);
+ CampList = new tagSCGoldRushCamp[CampCnt];
+ for (int i = 0; i < CampCnt; i ++) {
+ CampList[i] = new tagSCGoldRushCamp();
+ TransBytes (out CampList[i].CampID, vBytes, NetDataType.BYTE);
+ TransBytes (out CampList[i].GoldID, vBytes, NetDataType.BYTE);
+ TransBytes (out CampList[i].RefreshCnt, vBytes, NetDataType.WORD);
+ TransBytes (out CampList[i].EndTime, vBytes, NetDataType.DWORD);
+ TransBytes (out CampList[i].WorkerCnt, vBytes, NetDataType.BYTE);
+ }
+ }
+
+ public class tagSCGoldRushCamp {
+ public byte CampID; // 钀ュ湴ID锛屼粠1寮�濮�
+ public byte GoldID; // 娣橀噾ID锛屼负0鏃朵唬琛ㄨ钀ュ湴涓虹┖
+ public ushort RefreshCnt; // 宸插埛鏂版鏁�
+ public uint EndTime; // 棰勮瀹屾垚鏃剁殑鏃堕棿鎴筹紝涓�0鏃朵唬琛ㄨ繕鏈紑濮嬫窐閲戯紝閫氳繃璇ユ椂闂磋繘琛屽�掕鏃�
+ public byte WorkerCnt; // 浣跨敤鐩戝伐鏁�
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs.meta
new file mode 100644
index 0000000..4b0bdf8
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB0_Event/HB037_tagSCGoldRushCampInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 476e02628b591b04a8c6b8c725c3d7db
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Main.cs b/Main/Main.cs
index 133b3e0..a203ef7 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -80,6 +80,7 @@
managers.Add(AutoFightModel.Instance);
managers.Add(MainLevelManager.Instance);
managers.Add(BattleSettlementManager.Instance);
+ managers.Add(GoldRushManager.Instance);
foreach (var manager in managers)
{
diff --git a/Main/System/Battle/BattleField/StoryBattleField.cs b/Main/System/Battle/BattleField/StoryBattleField.cs
index bbd7cff..f454283 100644
--- a/Main/System/Battle/BattleField/StoryBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBattleField.cs
@@ -213,7 +213,7 @@
}
// 妫�鏌ヤ竴涓嬮敜瀛愮殑娑堣��
- if (!ItemLogicUtility.CheckCurrencyCount(41, PlayerDatas.Instance.baseData.UseHarmerCount, 2))
+ if (!UIHelper.CheckMoneyCount(41, PlayerDatas.Instance.baseData.UseHarmerCount, 2))
{
//澶氭闃茶寖
if (GetBattleMode() != BattleMode.Stop)
diff --git a/Main/System/Hero/UIHeroController.cs b/Main/System/Hero/UIHeroController.cs
index 852fcef..b86ec25 100644
--- a/Main/System/Hero/UIHeroController.cs
+++ b/Main/System/Hero/UIHeroController.cs
@@ -17,7 +17,7 @@
public void Create(int _skinID, float scale = 0.8f, Action _onComplete = null, string motionName = "idle", bool isLh = false)
{
if (skinID == _skinID)
- {
+ {
//閬垮厤閲嶅鍒涘缓
return;
}
@@ -49,7 +49,7 @@
lhImg.SetTexture2DPNG(skinConfig.Tachie);
lhImg.SetNativeSize();
if (skeletonGraphic != null)
- {
+ {
skeletonGraphic.enabled = false;
}
lhImg.enabled = true;
@@ -58,26 +58,26 @@
else
{
if (skeletonGraphic != null)
- {
+ {
skeletonGraphic.enabled = true;
}
lhImg.enabled = false;
}
}
else
- {
+ {
this.transform.localScale = Vector3.one * scale;
}
onComplete = _onComplete;
pool = GameObjectPoolManager.Instance.RequestPool(UILoader.LoadPrefab("UIHero"));
-
+
if (!transform.gameObject.activeSelf)
{
transform.SetActive(true);
}
if (instanceGO == null)
- {
+ {
instanceGO = pool.Request();
instanceGO.transform.SetParent(transform);
//transform 鐨凱ivot Y鏄�0锛岃instanceGO 灞呬腑
@@ -109,7 +109,7 @@
return;
}
skeletonGraphic.Initialize(true);
-
+
spineAnimationState = skeletonGraphic.AnimationState;
spineAnimationState.Data.DefaultMix = 0f;
if (motionName == "")
@@ -124,24 +124,32 @@
protected void OnDestroy()
{
- if (spineAnimationState != null)
- {
- spineAnimationState.Complete -= OnAnimationComplete;
- }
+ if (spineAnimationState != null)
+ {
+ spineAnimationState.Complete -= OnAnimationComplete;
+ }
if (pool != null)
pool.Release(instanceGO);
skeletonGraphic = null;
pool = null;
}
+ /// <summary>
+ /// 鎾斁 Spine 鍔ㄧ敾
+ /// </summary>
+ /// <param name="motionName">鍔ㄤ綔鍚�</param>
+ /// <param name="loop">寰幆</param>
+ /// <param name="replay">濡傛灉鐩稿悓鍔ㄤ綔鏄惁鍐嶆閲嶆挱锛屾瘮濡傝窇姝ラ噸鎾氨浼氳烦甯т笉椤烘粦</param>
+ public virtual void PlayAnimation(string motionName, bool loop = false, bool replay=true)
+ {
+ if (spineAnimationState == null) return;
- public virtual void PlayAnimation(string motionName, bool loop = false)
- {
- if (spineAnimationState == null) return;
+ if (GetCurrentAnimationName() == motionName && !replay)
+ return;
// 鐩存帴浣跨敤 ToString() 鑰屼笉鏄皟鐢� GetAnimationName
- spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
- }
+ spineAnimationState.SetAnimation(0, motionName.ToString(), loop);
+ }
// 鎾斁绗竴涓姩鐢伙紙浣滀负榛樿鍔ㄧ敾锛�
string GetFistSpineAnim()
@@ -156,7 +164,22 @@
Debug.LogError("Spine 鏁版嵁涓病鏈夋壘鍒颁换浣曞姩鐢伙紒姝﹀皢鐨偆锛�" + skinID);
}
return "";
- }
+ }
+
+ /// <summary>
+ /// 鑾峰彇褰撳墠姝e湪鎾斁鐨� Spine 鍔ㄧ敾鍚嶇О
+ /// </summary>
+ /// <returns>褰撳墠鍔ㄧ敾鍚嶇О锛屽鏋滄病鏈夊姩鐢诲垯杩斿洖绌哄瓧绗︿覆</returns>
+ public string GetCurrentAnimationName()
+ {
+ if (spineAnimationState == null || spineAnimationState.GetCurrent(0) == null)
+ {
+ return string.Empty;
+ }
+ return spineAnimationState.GetCurrent(0).Animation.Name;
+ }
+
+
/// <summary>
/// 鍔ㄧ敾瀹屾垚浜嬩欢澶勭悊
@@ -166,4 +189,18 @@
onComplete?.Invoke();
}
+ //瓒婂ぇ瓒婂揩
+ public void SetSpeed(float speed)
+ {
+ spineAnimationState.TimeScale = speed;
+ }
+
+ public void SetEnabled(bool isEnable)
+ {
+ if (skeletonGraphic == null)
+ {
+ return;
+ }
+ skeletonGraphic.enabled = isEnable;
+ }
}
\ No newline at end of file
diff --git a/Main/System/HeroUI/HeroModel.cs b/Main/System/HeroUI/HeroModel.cs
new file mode 100644
index 0000000..2aa4c4e
--- /dev/null
+++ b/Main/System/HeroUI/HeroModel.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+
+public class HeroModel : MonoBehaviour
+{
+ [SerializeField] UIHeroController heroModel;
+ public int heroSkinID = 0;
+ public float scale = 1;
+ public string actionName = "idle";
+ public bool enable = true;
+
+
+ public void Start()
+ {
+ heroModel.Create(heroSkinID, scale);
+ heroModel.PlayAnimation(actionName, true);
+ heroModel.SetEnabled(enable);
+ }
+}
+
diff --git a/Main/System/HeroUI/HeroModel.cs.meta b/Main/System/HeroUI/HeroModel.cs.meta
new file mode 100644
index 0000000..4f7bb7d
--- /dev/null
+++ b/Main/System/HeroUI/HeroModel.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 89cc2b60c03eb4043beae72ef97e2dd6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/AffairBaseWin.cs b/Main/System/InternalAffairs/AffairBaseWin.cs
index 725d243..8b5ae52 100644
--- a/Main/System/InternalAffairs/AffairBaseWin.cs
+++ b/Main/System/InternalAffairs/AffairBaseWin.cs
@@ -4,19 +4,119 @@
using UnityEngine.UI;
/// <summary>
-/// 鍐呮斂
+/// 鍐呮斂 - 鍩烘湰鐢ㄤ簬娣橀噾
/// </summary>
public class AffairBaseWin : UIBase
{
[SerializeField] Button bagBtn;
+ //娣橀噾鐩稿叧
+ [SerializeField] GameObject fullGoldRush;
+ [SerializeField] Image goldRushIcon;
+ [SerializeField] Text goldRushCountText;
+ [SerializeField] Button goldRushItemBtn;
+ [SerializeField] Image goldRushItemProcess;
+ [SerializeField] Text autoText;
+ [SerializeField] GameObject flowAutoEffect;
+ [SerializeField] Button autoBtn;
+
protected override void InitComponent()
{
bagBtn.AddListener(() =>
- {
- UIManager.Instance.OpenWindow<RolePackWin>();
- }
+ {
+ UIManager.Instance.OpenWindow<RolePackWin>();
+ }
+ );
+
+ goldRushIcon.SetIconWithMoneyType(52);
+ goldRushItemBtn.AddListener(() =>
+ {
+ ItemTipUtility.ShowMoneyTip(52, false);
+ }
+ );
+ autoBtn.AddListener(() =>
+ {
+ // UIManager.Instance.OpenWindow<RolePackWin>();
+ }
);
}
+ protected override void OnPreOpen()
+ {
+ GoldRushManager.Instance.OnGoldRushCampEvent += OnGoldRushCampEvent;
+ GoldRushManager.Instance.OnGoldRushInfoEvent += OnGoldRushInfoEvent;
+ GoldRushManager.Instance.OnAutoWorkingEvent += OnAutoWorkingEvent;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
+ Display();
+ GoldRushManager.Instance.GetAllAward();
+ }
+
+ protected override void OnPreClose()
+ {
+ GoldRushManager.Instance.OnGoldRushCampEvent -= OnGoldRushCampEvent;
+ GoldRushManager.Instance.OnGoldRushInfoEvent -= OnGoldRushInfoEvent;
+ GoldRushManager.Instance.OnAutoWorkingEvent -= OnAutoWorkingEvent;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
+ }
+
+ void Display()
+ {
+ fullGoldRush.SetActive(GoldRushManager.Instance.GetWarehouseCnt() >= GoldRushManager.Instance.maxWorkerCount);
+ RefreshGoldRushMoney();
+ autoText.text = Language.Get(GoldRushManager.Instance.isAutoWorking ? "GoldRush34" : "GoldRush24");
+ }
+
+ void OnGoldRushCampEvent(int campID)
+ {
+ }
+
+ void OnGoldRushInfoEvent()
+ {
+ fullGoldRush.SetActive(GoldRushManager.Instance.GetWarehouseCnt() >= GoldRushManager.Instance.maxWorkerCount);
+ }
+
+ void OnSecondEvent()
+ {
+ RefreshGoldRushMoney();
+ }
+
+ void OnAutoWorkingEvent()
+ {
+ if (GoldRushManager.Instance.isAutoWorking)
+ {
+ autoText.text = Language.Get("GoldRush34");
+ flowAutoEffect.SetActive(true);
+
+ }
+ else
+ {
+ autoText.text = Language.Get("GoldRush24");
+ flowAutoEffect.SetActive(false);
+ }
+ }
+
+ void RefreshGoldRushMoney()
+ {
+ var count = UIHelper.GetMoneyCnt(52);
+ if (count > 0)
+ {
+ goldRushCountText.text = count + "/" + GoldRushManager.Instance.goldRushMissionMaxCnt;
+ }
+ else
+ {
+ //鍊掕鏃�
+ goldRushCountText.text = TimeUtility.SecondsToMS(GoldRushManager.Instance.restoreMissionSeconds - (TimeUtility.AllSeconds - GoldRushManager.Instance.lastRecoverTime));
+ }
+ goldRushItemProcess.fillAmount = (float)count / GoldRushManager.Instance.goldRushMissionMaxCnt;
+ }
+
+ void PlayerDataRefreshEvent(PlayerDataType type)
+ {
+ if (type == PlayerDataType.GoldRush)
+ {
+ RefreshGoldRushMoney();
+ }
+ }
}
\ No newline at end of file
diff --git a/Main/System/InternalAffairs/AffairFuncCell.cs b/Main/System/InternalAffairs/AffairFuncCell.cs
new file mode 100644
index 0000000..d7842d9
--- /dev/null
+++ b/Main/System/InternalAffairs/AffairFuncCell.cs
@@ -0,0 +1,53 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+public class AffairFuncCell : MonoBehaviour
+{
+ [SerializeField] Image lockImg;
+ [SerializeField] ImageEx titleBG;
+ [SerializeField] Text titleText;
+ [SerializeField] Button funcBtn;
+ public int funcID;
+
+ void Start()
+ {
+ funcBtn.AddListener(OnClickFunc);
+ }
+
+ void OnEnable()
+ {
+ if (funcID != 0 &&FuncOpen.Instance.IsFuncOpen(funcID))
+ {
+ lockImg.SetActive(false);
+ titleBG.gray = false;
+ //DED4C8
+ titleText.color = new Color32(222, 212, 200, 255);
+ }
+ else
+ {
+ lockImg.SetActive(true);
+ titleBG.gray = true;
+ titleText.color = UIHelper.GetUIColor(TextColType.Gray);
+ }
+
+ }
+
+ void OnClickFunc()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen(funcID, true))
+ {
+ return;
+ }
+
+ if (funcID == 8)
+ {
+ UIManager.Instance.OpenWindow<GoldRushWorkerWin>();
+ }
+ // else if (funcID == 214)
+ // {
+ // GoldRushManager.Instance.NotifyGoldRushEvent(0, 0, 2);
+ // }
+
+ }
+}
+
diff --git a/Main/System/InternalAffairs/AffairFuncCell.cs.meta b/Main/System/InternalAffairs/AffairFuncCell.cs.meta
new file mode 100644
index 0000000..23bd13f
--- /dev/null
+++ b/Main/System/InternalAffairs/AffairFuncCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1174ff753f469044dbcaba6514326b56
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushLeader.cs b/Main/System/InternalAffairs/GoldRushLeader.cs
new file mode 100644
index 0000000..ca2dc1a
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushLeader.cs
@@ -0,0 +1,201 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening;
+using Cysharp.Threading.Tasks;
+using System;
+
+public class GoldRushLeader : MonoBehaviour
+{
+ [SerializeField] UIHeroController leader; //鐩戝伐
+ // [SerializeField] GameObject goods;
+ [SerializeField] RectTransform leaderGo;
+ [SerializeField] UIAlphaTween leaderWord;
+ [SerializeField] Text leaderText;
+ public float leaderScale = 0.6f;
+
+ public Tween leaderSequence;
+ private int leaderPosIndex = -1; //鐩戝伐宸茶揪绉诲姩鐐�
+ private int state = 0; //0 绔欏矖(涓嶆樉绀�) 1 鍓嶈繘 2 绌烘墜杩旂▼ 3 璐х墿杩旂▼锛堜笉涓柇锛�
+
+ int tendID;
+ GoldRushPosEvent[] leaderPathPointArr; //鐩戝伐绉诲姩鐐�
+
+ Action<bool> OnComplete;
+
+ public void Init(GoldRushPosEvent[] _leaderPathPointArr, float waitTime, int _tendID, bool isBack, Action<bool> _OnComplete)
+ {
+ tendID = _tendID;
+ leaderPathPointArr = _leaderPathPointArr;
+ leaderPosIndex = !isBack ? -1: leaderPathPointArr.Length - 1;
+ state = 0;
+ leaderWord.Stop();
+ leaderWord.SetEndState();
+ // goods.SetActive(isBack);
+ leaderGo.localPosition = !isBack ? leaderPathPointArr[0].transform.localPosition :
+ leaderPathPointArr[leaderPathPointArr.Length - 1].transform.localPosition;
+ OnComplete = _OnComplete;
+ this.SetActive(true);
+ leader.Create(GoldRushManager.Instance.GetRandommSkinID(), leaderScale);
+ Go(waitTime, isBack).Forget();
+ }
+
+
+
+ async UniTask Go(float waitTime, bool isBack)
+ {
+ int delayTime = Math.Max(1, (int)(waitTime * 1000));
+ await UniTask.Delay(delayTime);
+ StartLeaderMove(isBack);
+ }
+
+ public void StartLeaderMove(bool isBack)
+ {
+ leaderSequence.Kill();
+
+ leaderWord.Stop();
+ leaderWord.SetEndState();
+ LeaderMove(isBack);
+
+ }
+
+ void LeaderMove(bool isBack)
+ {
+ int moveIndex = isBack ? leaderPosIndex - 1 : leaderPosIndex + 1;
+ //鍒ゆ柇浜嬩欢, 杩旂▼鐢ㄥ綋鍓嶇偣浜嬩欢锛屽嚭鍙戠敤涓嬩竴涓偣鐨勪簨浠�
+ GoldRushPosEvent pathPosEvent = isBack ? leaderPathPointArr[leaderPosIndex] : leaderPathPointArr[moveIndex];
+
+ if (moveIndex <= 0)
+ {
+ moveIndex = 0;
+ }
+ else if (moveIndex >= leaderPathPointArr.Length)
+ {
+ moveIndex = leaderPathPointArr.Length - 1;
+ }
+
+ Vector3 nextPos = leaderPathPointArr[moveIndex].transform.localPosition;
+ leader.PlayAnimation("run", true, false);
+
+ leaderPosIndex = moveIndex;
+ bool isRush = pathPosEvent.m_PosEvent == PosEvent.Rush;
+ bool isJump = pathPosEvent.m_PosEvent == PosEvent.Jump;
+
+ leader.SetSpeed((isRush ? 2 : 1) * (isBack ? 0.5f : 1));
+
+
+ var dis = Vector3.Distance(leaderGo.localPosition, nextPos);
+ var duration = dis / pathPosEvent.m_Speed / (isBack ? pathPosEvent.m_BackSlowSpeedScale : 1);
+
+ // Debug.Log("绗�" + workerIndex + "涓伐浜�" + " duration" + duration + " 绉诲姩index " + moveIndex + " Time=" + Time.time);
+ if (leaderGo.localPosition.x < nextPos.x)
+ {
+ leader.transform.localRotation = Quaternion.Euler(0, 0, 0);
+ }
+ else
+ {
+ //杞悜
+ leader.transform.localRotation = Quaternion.Euler(0, 180, 0);
+ }
+
+ PathEvent(pathPosEvent, isBack);
+
+ if (!isJump)
+ {
+ leaderSequence = leaderGo.DOLocalMove(nextPos, duration).SetEase(pathPosEvent.m_EaseType);
+ }
+ else
+ {
+ //鎶涚墿绾胯烦璺�
+ // 璁$畻鎶涚墿绾胯矾寰勭偣
+ Vector3[] path = new Vector3[3];
+ path[0] = leaderGo.localPosition; // 璧风偣
+ //椤剁偣x 鏄袱鑰呬箣闂� y澧炲姞楂樺害
+ path[1] = new Vector3(nextPos[0] + (leaderGo.localPosition.x - nextPos[0]) / 2, nextPos[1] + pathPosEvent.m_Value1, nextPos.z);
+ path[2] = nextPos; // 缁堢偣
+
+ // 浣跨敤 DOPath 瀹炵幇鎶涚墿绾跨Щ鍔�
+ leaderSequence = leaderGo.DOLocalPath(path, pathPosEvent.m_Value2, PathType.CatmullRom).SetEase(pathPosEvent.m_EaseType);
+ }
+ leaderSequence.OnComplete(() =>
+ {
+ // Debug.Log("Sequence completed for worker " + workerIndex);
+ if (moveIndex == (isBack ? 0 : leaderPathPointArr.Length - 1))
+ {
+ leader.PlayAnimation("idle", true, false);
+ leader.transform.localRotation = Quaternion.Euler(0, 0, 0);
+
+ this.SetActive(false);
+ OnComplete(isBack);
+ return;
+ }
+ LeaderMove(isBack);
+ });
+
+ }
+
+ void PathEvent(GoldRushPosEvent pathPosEvent, bool isBack)
+ {
+ if (isBack)
+ {
+ return;
+ }
+
+ if (pathPosEvent.m_PosEvent == PosEvent.TargetFollow)
+ {
+ // StartMove(isBack);
+ GoldRushManager.Instance.NotifyPathEvent(pathPosEvent.m_PosEvent, isBack, tendID, 0, "");
+ }
+ else if (pathPosEvent.m_PosEvent == PosEvent.Word)
+ {
+ leaderWord.SetActive(true);
+ leaderWord.Play();
+ leaderText.text = Language.Get(pathPosEvent.m_Text1);
+ }
+ else if (pathPosEvent.m_PosEvent == PosEvent.TargetWord)
+ {
+
+ if (!pathPosEvent.m_IsRandom)
+ {
+ //鎸囧畾璇█
+ if (pathPosEvent.m_Value1 <= 0)
+ {
+ //鍏ㄤ綋璇磋瘽
+ for (int i = 0; i < GoldRushManager.followWorkerCount; i++)
+ {
+ GoldRushManager.Instance.NotifyPathEvent(pathPosEvent.m_PosEvent, isBack, tendID, i, pathPosEvent.m_Text1);
+ }
+ }
+ else
+ {
+ //鍗曚釜璇磋瘽
+ GoldRushManager.Instance.NotifyPathEvent(pathPosEvent.m_PosEvent, isBack, tendID, (int)pathPosEvent.m_Value1 - 1, pathPosEvent.m_Text1);
+ }
+ }
+ else
+ {
+ //闅忔満鍏ㄤ綋璇磋瘽
+ for (int i = 0; i < GoldRushManager.followWorkerCount; i++)
+ {
+ GoldRushManager.Instance.NotifyPathEvent(pathPosEvent.m_PosEvent, isBack, tendID, i,
+ pathPosEvent.m_Text1 + UnityEngine.Random.Range((int)pathPosEvent.m_Value1, (int)pathPosEvent.m_Value2));
+ }
+ }
+ }
+ else if (pathPosEvent.m_PosEvent == PosEvent.TargetAction)
+ {
+ for (int i = 0; i < GoldRushManager.followWorkerCount; i++)
+ {
+ GoldRushManager.Instance.NotifyPathEvent(pathPosEvent.m_PosEvent, isBack, tendID, i, pathPosEvent.m_Text1);
+ }
+ }
+ else if (pathPosEvent.m_PosEvent == PosEvent.Action)
+ {
+ leader.PlayAnimation(pathPosEvent.m_Text1);
+ }
+
+ }
+
+
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushLeader.cs.meta b/Main/System/InternalAffairs/GoldRushLeader.cs.meta
new file mode 100644
index 0000000..1be9768
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushLeader.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5883f3be9e7c13d42b68d2ac570a9bf6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushManager.cs b/Main/System/InternalAffairs/GoldRushManager.cs
new file mode 100644
index 0000000..4af187f
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushManager.cs
@@ -0,0 +1,524 @@
+锘縰sing System;
+using LitJson;
+
+using System.Collections.Generic;
+
+//娣橀噾鍔熻兘
+public class GoldRushManager : GameSystemManager<GoldRushManager>
+{
+ public const int funcID = 8;
+ int campUnlockState;
+ int workerUnlockState;
+ public int panningCnt; //绱鎬绘鏁�
+ public int lastRecoverTime; // 涓婃鍏嶈垂鎭㈠娣橀噾浠ゆ椂闂存埑锛屼负0鏃跺彲涓嶇敤鍊掕鏃�
+ public int housekeeperEndTime; // 鑷姩绠″鍒版湡鏃堕棿鎴筹紝鏈夊�煎悓鏃朵篃浠h〃鍏嶈垂璇曠敤宸蹭娇鐢�
+ public byte[] warehouseIDList;
+ public Dictionary<int, HB037_tagSCGoldRushCampInfo.tagSCGoldRushCamp> campInfoDict = new Dictionary<int, HB037_tagSCGoldRushCampInfo.tagSCGoldRushCamp>();
+
+ public event Action<int> OnGoldRushCampEvent; //鏈嶅姟绔�氱煡钀ュ湴淇℃伅
+ public event Action OnGoldRushInfoEvent;
+
+
+ //琛屼负浜嬩欢
+ public event Action<int> OnRefreshItemEvent; //鍒锋柊娣橀噾閬撳叿
+ public event Action<int, int, int> GoldRushEvent; //钀ュ湴ID锛屾墽琛屼簨浠讹紙0鍑哄彂锛�1杩旂▼锛夛紝鐩戝伐鏁伴噺
+ public event Action<PosEvent, bool, int, int, string> PathEvent; //浜嬩欢锛屾槸鍚﹁繑绋嬶紝钀ュ湴ID锛岀鍑犱釜宸ヤ汉锛岃亰澶╁唴瀹癸紙鍚庣画鑰冭檻浼犵粨鏋勬暟鎹級
+
+ public const int followWorkerCount = 3; //灏忓叺鐨勬暟閲忥紝闈炵洃宸�
+
+ int m_MaxWorkerCount; //閰嶈〃鐨勬渶澶ф暟閲�
+ //鐩戝伐鐨勬暟閲忥紝瑙i攣褰卞搷
+ public int maxWorkerCount
+ {
+ get
+ {
+ int count = 0;
+ for (int i = 1; i <= m_MaxWorkerCount; i++)
+ {
+ if (IsWorkerUnLock(i))
+ {
+ count++;
+ }
+ }
+ return count;
+ }
+ }
+ public List<int> skinIDs = new List<int>(); //闅忔満鐨勭洃宸ョ毊鑲� ,宸茶В閿�
+
+ public int selectCampID;
+ bool m_IsAutoWorking; //鏄惁鏆傚仠
+ //鏄惁鍦ㄦ墽琛岃嚜鍔ㄧ瀹讹紝娌℃湁娣橀噾浠ゆ椂鏆傚仠,浠撳簱婊℃殏鍋�
+ public bool isAutoWorking
+ {
+ get
+ {
+ return m_IsAutoWorking && isOpenAuto;
+ }
+ }
+ public bool isOpenAuto; //鏄惁寮�鍚嚜鍔ㄧ瀹�,閲嶇櫥浼氬彇娑�
+
+ public event Action OnAutoWorkingEvent;
+
+
+ //閰嶇疆
+ public int refreshMoneyType;
+ public int[] refreshMoneyList;
+ public Dictionary<int, int> itemIDUnLockFuncIDDict = new Dictionary<int, int>();
+
+ bool openAutoGoldRush
+ {
+ get
+ {
+ return housekeeperEndTime > 0 && TimeUtility.AllSeconds < housekeeperEndTime;
+ }
+ }
+
+ //娣橀噾浠撳簱锛堝凡瀹屾垚浠诲姟鏈鍙栫殑瀛樺偍锛変笂闄�
+ int warehouseBaseCnt;
+ int warehouseAddCnt;
+ public int warehouseMaxCnt
+ {
+ get
+ {
+ return warehouseBaseCnt + (openAutoGoldRush ? warehouseAddCnt : 0);
+ }
+ }
+
+ //娣橀噾浠�(浠诲姟鏈仛鐨�)涓婇檺
+ int goldRushMissionBaseCnt;
+ int goldRushMissionAddCnt;
+ public int goldRushMissionMaxCnt
+ {
+ get
+ {
+ return goldRushMissionBaseCnt + (openAutoGoldRush ? goldRushMissionAddCnt : 0);
+ }
+ }
+
+ public int restoreMissionSeconds; //鑷姩鎭㈠浠诲姟鏃堕棿
+
+ public int freeAutoDays; //鍏嶈垂璇曠敤澶╂暟
+
+ public List<int> buyAutoDaysList = new List<int>(); //璐拱鑷姩绠″澶╂暟
+ public List<int> buyAutoCTGIDList = new List<int>(); //璐拱鑷姩绠″CTGID
+
+ public PlayerDataType unLockMoneyType; //鍒锋柊鐢�
+
+ public override void Init()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize;
+ PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefresh;
+
+ m_MaxWorkerCount = GoldRushWorkerConfig.GetKeys().Count;
+
+ ParseConfig();
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize;
+ PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefresh;
+ }
+
+ void ParseConfig()
+ {
+ var config = FuncConfigConfig.Get("GoldRushRefresh");
+ refreshMoneyType = int.Parse(config.Numerical2);
+ refreshMoneyList = JsonMapper.ToObject<int[]>(config.Numerical3);
+ itemIDUnLockFuncIDDict = ConfigParse.ParseIntDict(config.Numerical5);
+
+ config = FuncConfigConfig.Get("GoldRush");
+ var countArr = ConfigParse.GetMultipleStr<int>(config.Numerical1);
+ warehouseBaseCnt = countArr[0];
+ warehouseAddCnt = countArr[1];
+ countArr = ConfigParse.GetMultipleStr<int>(config.Numerical2);
+ goldRushMissionBaseCnt = countArr[0];
+ goldRushMissionAddCnt = countArr[1];
+ restoreMissionSeconds = int.Parse(config.Numerical3) * 60;
+
+ config = FuncConfigConfig.Get("GoldRushAuto");
+ var tmpArr = JsonMapper.ToObject<int[]>(config.Numerical1);
+ freeAutoDays = tmpArr[0];
+ for (int i = 1; i < tmpArr.Length; i++)
+ {
+ buyAutoDaysList.Add(tmpArr[i]);
+ }
+ var tmpArr2 = JsonMapper.ToObject<int[][]>(config.Numerical2);
+ for (int i = 0; i < tmpArr2.Length; i++)
+ {
+ buyAutoCTGIDList.Add(tmpArr2[i][0]);
+ }
+
+ }
+
+ void OnBeforePlayerDataInitialize()
+ {
+ campUnlockState = 0;
+ workerUnlockState = 0;
+ panningCnt = 0;
+ housekeeperEndTime = 0;
+ warehouseIDList = new byte[0];
+ lastRecoverTime = 0;
+ campInfoDict.Clear();
+ isOpenAuto = false;
+ }
+
+
+
+ void OnPlayerDataRefresh(PlayerDataType type)
+ {
+ //unLockMoneyType鏈祴鍊煎垯涓嶄細鍒锋柊 鍑忓皯杩愯
+ if (type == unLockMoneyType)
+ {
+ UpdateRedpoint();
+ }
+ else if (type == PlayerDataType.GoldRush)
+ {
+ SetAutoWorking(isOpenAuto, UIHelper.GetMoneyCnt(52) > 0);
+ }
+ }
+
+
+ public int GetRandommSkinID()
+ {
+ //浠庡凡瑙i攣涓殢鏈�
+ return skinIDs[UnityEngine.Random.Range(0, skinIDs.Count)];
+ }
+
+ void RefreshUnLockSkinID()
+ {
+ skinIDs.Clear();
+ foreach (var item in GoldRushWorkerConfig.GetValues())
+ {
+ if (IsWorkerUnLock(item.WorkerID))
+ {
+ skinIDs.Add(item.SkinID);
+ }
+ }
+ }
+
+ public void UpdateGoldRushInfo(HB036_tagSCGoldRushInfo netPack)
+ {
+ campUnlockState = (int)netPack.CampState;
+ if (workerUnlockState != netPack.WorkerState)
+ {
+ workerUnlockState = (int)netPack.WorkerState;
+ RefreshUnLockSkinID();
+ }
+ panningCnt = (int)netPack.PanningCnt;
+ housekeeperEndTime = (int)netPack.HousekeeperEndTime;
+ warehouseIDList = netPack.WarehouseIDList;
+ lastRecoverTime = (int)netPack.LastRecoverTime;
+ UpdateRedpoint();
+ OnGoldRushInfoEvent?.Invoke();
+ }
+
+ public void UpdateGoldRushCampInfo(HB037_tagSCGoldRushCampInfo netPack)
+ {
+ for (int i = 0; i < netPack.CampCnt; i++)
+ {
+ campInfoDict[netPack.CampList[i].CampID] = netPack.CampList[i]; ;
+ OnGoldRushCampEvent?.Invoke(netPack.CampList[i].CampID);
+ }
+ UpdateRedpoint();
+
+ }
+
+ //鑾峰彇娣橀噾浠撳簱鎬婚噺鍚鍦ㄦ墽琛岀殑
+ public int GetWarehouseCnt()
+ {
+ //鎺掓煡0
+ int cnt = 0;
+ foreach (var item in warehouseIDList)
+ {
+ if (item != 0)
+ {
+ cnt++;
+ }
+ }
+ foreach (var item in campInfoDict.Values)
+ {
+ if (item.GoldID != 0 && item.EndTime != 0)
+ {
+ cnt++;
+ }
+ }
+ return cnt;
+ }
+
+ //鑾峰彇娣橀噾ID
+ public int GetCampGoldID(int campID)
+ {
+ if (campInfoDict.ContainsKey(campID))
+ {
+ return campInfoDict[campID].GoldID;
+ }
+ return 0;
+ }
+
+ //鑾峰彇钀ュ湴宸ヤ汉
+ public int GetCampWorkerCnt(int campID)
+ {
+ if (campInfoDict.ContainsKey(campID))
+ {
+ return campInfoDict[campID].WorkerCnt;
+ }
+ return 0;
+ }
+
+ public int GetEmptyWorkerCount()
+ {
+ int count = 0;
+ foreach (var item in campInfoDict.Values)
+ {
+ count += item.WorkerCnt;
+ }
+ return maxWorkerCount - count;
+ }
+
+ //鑾峰彇钀ュ湴鍒锋柊娆℃暟
+ public int GetCampRefreshCnt(int campID)
+ {
+ if (campInfoDict.ContainsKey(campID))
+ {
+ return campInfoDict[campID].RefreshCnt;
+ }
+ return 0;
+ }
+
+ //鑾峰彇钀ュ湴缁撴潫鏃堕棿锛�0浠h〃鏈紑濮�
+ public int GetCampEndTime(int campID)
+ {
+ if (campInfoDict.ContainsKey(campID))
+ {
+ if (campInfoDict[campID].GoldID == 0)
+ {
+ return 0;
+ }
+ return (int)campInfoDict[campID].EndTime;
+ }
+ return 0;
+ }
+
+
+ public string GetCampItemName(GoldRushItemConfig config)
+ {
+ return UIHelper.AppendColor(config.ItemLV, Language.Get("L1113", config.ItemLV) + " " + ItemConfig.Get(config.ItemID).ItemName);
+ }
+
+
+ //钀ュ湴鏄惁宸茶В閿�
+ public bool IsCampUnLock(int campID)
+ {
+ return (campUnlockState & (1 << campID)) != 0;
+ }
+
+ //宸ヤ汉鏄惁宸茶В閿�
+ public bool IsWorkerUnLock(int workerID)
+ {
+ return (workerUnlockState & (1 << workerID)) != 0;
+ }
+
+ // 0-鍙戝竷娣橀噾(娑堣�楁窐閲戜护)锛�1-鍒锋柊娣橀噾锛�2-寮�濮嬫窐閲戞垨璋冩暣鐩戝伐鏁帮紱3-鍙栨秷娣橀噾
+ public void SendGoldRushOP(int opType, int campID, int workerCnt)
+ {
+ var pack = new CB036_tagCSGoldRushOP();
+ pack.OPType = (byte)opType;
+ pack.CampID = (byte)campID;
+ pack.WorkerCnt = (byte)workerCnt;
+ GameNetSystem.Instance.SendInfo(pack);
+ if (opType <= 1)
+ {
+ OnRefreshItemEvent?.Invoke(campID);
+ }
+ }
+
+ //瑙i攣 0-钀ュ湴锛�1-鐩戝伐
+ public void SendGoldRushUnlock(int unlockType, int id)
+ {
+ var pack = new CB037_tagCSGoldRushUnlock();
+ pack.UnlockType = (byte)unlockType;
+ pack.UnlockID = (byte)id;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ public void SendGoldRushWarehouseAward(int index, int isAll)
+ {
+ var pack = new CB038_tagCSGoldRushWarehouseAward();
+ pack.AwardIndex = (byte)index;
+ pack.IsAll = (byte)isAll;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+
+ public void GetAllAward()
+ {
+ if (CheckHasFinishGoldRush())
+ {
+ SendGoldRushWarehouseAward(0, 1);
+ }
+ }
+
+
+ //閫氱煡澶栧嚭琛屼负浜嬩欢
+ public void NotifyGoldRushEvent(int campID, int eventType, int leaderCount)
+ {
+ GoldRushEvent?.Invoke(campID, eventType, leaderCount);
+ }
+
+ //閫氱煡璺緞琛屼负浜嬩欢
+ public void NotifyPathEvent(PosEvent posEvent, bool isBack, int tendID, int index, string content)
+ {
+ PathEvent?.Invoke(posEvent, isBack, tendID, index, content);
+ }
+
+
+ //绾㈢偣锛氬彲棰嗗彇锛屽彲瑙i攣鐨勭洃宸�
+ Redpoint redpoint = new Redpoint(MainRedDot.MainAffairsRedpoint, MainRedDot.BlessedLandRedpoint);
+
+ //鍙В閿佺殑鐩戝伐
+ Redpoint workerRedpoint = new Redpoint(MainRedDot.BlessedLandRedpoint, MainRedDot.BlessedLandRedpoint * 10 + 1);
+
+ //鍙鍙栫殑濂栧姳
+ Redpoint awardRedpoint = new Redpoint(MainRedDot.BlessedLandRedpoint, MainRedDot.BlessedLandRedpoint * 10 + 2);
+ //钀ュ湴瑙i攣绾㈢偣
+ Redpoint campRedpoint = new Redpoint(MainRedDot.MainAffairsRedpoint, MainRedDot.BlessedLandRedpoint * 10);
+
+ void UpdateRedpoint()
+ {
+ if (CheckCanUnLockWorker())
+ {
+ workerRedpoint.state = RedPointState.Simple;
+ }
+ else
+ {
+ workerRedpoint.state = RedPointState.None;
+ }
+
+ if (CheckHasFinishGoldRush())
+ {
+ awardRedpoint.state = RedPointState.Simple;
+ }
+ else
+ {
+ awardRedpoint.state = RedPointState.None;
+ }
+
+
+ campRedpoint.state = CheckCanUnLockCamp() ? RedPointState.Simple : RedPointState.None;
+ }
+
+ //鐜╁鏁版嵁绫诲瀷
+ void InitUnlockMoney(int type)
+ {
+ unLockMoneyType = UIHelper.moneyTypeToPlayerDataType[type];
+ }
+
+ //妫�鏌ユ槸鍚︽湁鍙В閿佺殑鐩戝伐
+ bool CheckCanUnLockWorker()
+ {
+ foreach (var workerID in GoldRushWorkerConfig.GetKeys())
+ {
+ if (IsWorkerUnLock(workerID))
+ {
+ continue;
+ }
+ var config = GoldRushWorkerConfig.Get(workerID);
+ if (config.MoneyUnlock.Length != 0)
+ {
+ InitUnlockMoney(config.MoneyUnlock[0]);
+
+ if (UIHelper.GetMoneyCnt(config.MoneyUnlock[0]) < config.MoneyUnlock[1])
+ {
+ continue;
+ }
+ }
+
+ if (config.PlayerLVUnlock != 0 && PlayerDatas.Instance.baseData.LV < config.PlayerLVUnlock)
+ {
+ continue;
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ bool CheckHasFinishGoldRush()
+ {
+ //闈�0
+ foreach (var id in warehouseIDList)
+ {
+ if (id != 0)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ //妫�鏌ユ槸鍚︽湁鍙В閿佺殑钀ュ湴
+ bool CheckCanUnLockCamp()
+ {
+ foreach (var campID in GoldRushCampConfig.GetKeys())
+ {
+ if (IsCampUnLock(campID))
+ {
+ continue;
+ }
+
+ var config = GoldRushCampConfig.Get(campID);
+ if (config.MoneyUnlock.Length != 0)
+ {
+ InitUnlockMoney(config.MoneyUnlock[0]);
+
+ if (UIHelper.GetMoneyCnt(config.MoneyUnlock[0]) < config.MoneyUnlock[1])
+ {
+ continue;
+ }
+ }
+
+ if (config.PanningUnlock != 0 && panningCnt < config.PanningUnlock)
+ {
+ continue;
+ }
+
+
+ return true;
+
+ }
+ return false;
+ }
+
+
+ //0 宸茶В閿� 1 娆℃暟閿� 2 閲戦挶閿�
+ public int GetCampLockState(int campID)
+ {
+ if (IsCampUnLock(campID))
+ {
+ return 0;
+ }
+ var config = GoldRushCampConfig.Get(campID);
+ if (config.PanningUnlock != 0)
+ {
+ return 1;
+ }
+
+ if (config.MoneyUnlock.Length != 0)
+ {
+ return 2;
+ }
+
+ return 0;
+
+ }
+
+ //鑷姩娣橀噾 鍏堝~鍏呰惀鍦� 鍐嶅~鍏呭涓洃宸�
+
+ void SetAutoWorking(bool _isOpenAuto, bool _isAutoWorking)
+ {
+ isOpenAuto = _isOpenAuto;
+ m_IsAutoWorking = _isAutoWorking;
+ OnAutoWorkingEvent?.Invoke();
+ }
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushManager.cs.meta b/Main/System/InternalAffairs/GoldRushManager.cs.meta
new file mode 100644
index 0000000..ab37afa
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushManager.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5469d328bac371545a71f569744fc63f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushPosEvent.cs b/Main/System/InternalAffairs/GoldRushPosEvent.cs
new file mode 100644
index 0000000..103cf2b
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushPosEvent.cs
@@ -0,0 +1,31 @@
+using DG.Tweening;
+using UnityEngine;
+
+public class GoldRushPosEvent : MonoBehaviour
+{
+ [Header("鎵�鏈夌偣閮芥槸绉诲姩鐩殑鍦帮紝闄勫姞浜嬩欢涓嶅悓")]
+ public PosEvent m_PosEvent;
+ public Ease m_EaseType = Ease.Linear;
+ public float m_Speed = 200;
+ public float m_BackSlowSpeedScale = 0.5f; //甯﹁揣鐗╁洖绋嬮�熷害鏀炬參鐧惧垎姣�
+ public bool m_IsRandom = false;
+
+ public float m_Value1 = 0;
+ public float m_Value2 = 0;
+ public string m_Text1 = string.Empty;
+
+
+}
+
+public enum PosEvent
+{
+ Move,
+ Rush,
+ Jump,
+ Word, //姝﹀皢鑷繁鑱婂ぉ
+ Action,
+ TargetFollow, //鎸囧畾钀ュ湴璺熼殢
+ TargetWord, //鑱婂ぉ
+ TargetAction,
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushPosEvent.cs.meta b/Main/System/InternalAffairs/GoldRushPosEvent.cs.meta
new file mode 100644
index 0000000..84cce70
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushPosEvent.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2604f54884b49b74ab9f64c9fdd9532a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushRefreshWin.cs b/Main/System/InternalAffairs/GoldRushRefreshWin.cs
new file mode 100644
index 0000000..c690112
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushRefreshWin.cs
@@ -0,0 +1,270 @@
+using System;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 娣橀噾鍒锋柊鐣岄潰
+/// </summary>
+public class GoldRushRefreshWin : UIBase
+{
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Text nameText;
+ [SerializeField] CountControler countControler;
+
+ [SerializeField] Text timeText;
+ [SerializeField] Text moneyText;
+ [SerializeField] Image iconImg;
+
+ [SerializeField] Transform refreshRect;
+ [SerializeField] ButtonEx refreshBtn;
+ [SerializeField] ButtonEx workBtn;
+ [SerializeField] ButtonEx callBackBtn;
+ [SerializeField] Text callBackText;
+ [SerializeField] Text workingText;
+
+ GoldRushItemConfig config;
+ int workerCount;
+
+ protected override void InitComponent()
+ {
+ workBtn.AddListener(DoingWork);
+ refreshBtn.AddListener(RefreshItem);
+ callBackBtn.AddListener(CallBackWorker);
+ }
+
+
+
+ protected override void OnPreOpen()
+ {
+ GoldRushManager.Instance.OnGoldRushCampEvent += OnGoldRushCampEvent;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ var goldID = GoldRushManager.Instance.GetCampGoldID(GoldRushManager.Instance.selectCampID);
+ if (goldID == 0)
+ {
+ DelayCloseWindow().Forget();
+ return;
+ }
+
+
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ GoldRushManager.Instance.OnGoldRushCampEvent -= OnGoldRushCampEvent;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ }
+
+
+ void Display()
+ {
+ var goldID = GoldRushManager.Instance.GetCampGoldID(GoldRushManager.Instance.selectCampID);
+ config = GoldRushItemConfig.Get(goldID);
+ int emptyCnt = GoldRushManager.Instance.GetEmptyWorkerCount();
+
+ itemCell.Init(new ItemCellModel(config.ItemID, false, config.ItemCount));
+ nameText.text = GoldRushManager.Instance.GetCampItemName(config);
+ var endTime = GoldRushManager.Instance.GetCampEndTime(GoldRushManager.Instance.selectCampID);
+ if (endTime == 0)
+ {
+ //鏈紑濮�
+ timeText.text = TimeUtility.SecondsToMS(config.NeedSeconds);
+ refreshRect.SetActive(true);
+ callBackBtn.SetActive(false);
+
+ iconImg.SetIconWithMoneyType(GoldRushManager.Instance.refreshMoneyType);
+ moneyText.text = UIHelper.ShowUseMoney(GoldRushManager.Instance.refreshMoneyType, GetRefreshMoney());
+ workBtn.SetInteractable(emptyCnt != 0);
+ workerCount = Math.Min(emptyCnt, 1);
+ }
+ else
+ {
+ timeText.text = TimeUtility.SecondsToMS(endTime - TimeUtility.AllSeconds);
+ refreshRect.SetActive(false);
+ callBackBtn.SetActive(true);
+ RefreshCallBackBtn();
+ workerCount = GoldRushManager.Instance.GetCampWorkerCnt(GoldRushManager.Instance.selectCampID);
+ }
+ countControler.Init(ChangeWorkerCount, config.WorkerMax, workerCount, AddWorker, DecWorker);
+ }
+
+ void RefreshCallBackBtn()
+ {
+ var realCnt = GoldRushManager.Instance.GetCampWorkerCnt(GoldRushManager.Instance.selectCampID);
+ if (workerCount == 0)
+ {
+ callBackBtn.SetInteractable(true);
+ callBackText.text = Language.Get("GoldRush33"); //鎾ゅ洖鐩戝伐
+ }
+ else if (realCnt == workerCount)
+ {
+ callBackBtn.SetInteractable(false);
+ callBackText.text = Language.Get("GoldRush14"); //璋冩暣鐩戝伐
+ }
+ else
+ {
+ callBackBtn.SetInteractable(true);
+ callBackText.text = Language.Get("GoldRush14"); //璋冩暣鐩戝伐
+ }
+ }
+
+ void OnSecondEvent()
+ {
+ var endTime = GoldRushManager.Instance.GetCampEndTime(GoldRushManager.Instance.selectCampID);
+ if (endTime != 0)
+ {
+ timeText.text = TimeUtility.SecondsToMS(endTime - TimeUtility.AllSeconds);
+
+ var addStr = new string('.', (int)Time.time % 4);
+ workingText.text = Language.Get("GoldRush37") + addStr;
+ }
+ }
+
+ int GetRefreshMoney()
+ {
+ var refreshCnt = GoldRushManager.Instance.GetCampRefreshCnt(GoldRushManager.Instance.selectCampID);
+ return GoldRushManager.Instance.refreshMoneyList[Math.Min(refreshCnt, GoldRushManager.Instance.refreshMoneyList.Length - 1)];
+ }
+
+ void OnGoldRushCampEvent(int campID)
+ {
+ if (campID != GoldRushManager.Instance.selectCampID)
+ {
+ return;
+ }
+ var goldID = GoldRushManager.Instance.GetCampGoldID(GoldRushManager.Instance.selectCampID);
+ if (goldID == 0)
+ {
+ //宸插畬鎴�
+ CloseWindow();
+ return;
+ }
+ Display();
+ }
+
+ void ChangeWorkerCount(int count)
+ {
+ workerCount = count;
+ var endTime = GoldRushManager.Instance.GetCampEndTime(GoldRushManager.Instance.selectCampID);
+ if (endTime == 0)
+ {
+ //鏈紑濮�
+ timeText.text = TimeUtility.SecondsToMS(config.NeedSeconds / Math.Max(1, count));
+ }
+ else
+ {
+ timeText.text = TimeUtility.SecondsToMS(endTime - TimeUtility.AllSeconds);
+ RefreshCallBackBtn();
+ }
+ }
+
+ bool AddWorker(int count)
+ {
+ if (count >= config.WorkerMax)
+ {
+ return false;
+ }
+
+ //鍙淳閬g殑鐩戝伐锛� 绌洪棽鐩戝伐鏁�+褰撳墠鐩戝伐鏁�
+ if (count + 1 > GoldRushManager.Instance.GetEmptyWorkerCount() + GoldRushManager.Instance.GetCampWorkerCnt(GoldRushManager.Instance.selectCampID))
+ {
+ SysNotifyMgr.Instance.ShowTip("GoldRush2");
+ return false;
+ }
+
+ return true;
+ }
+
+ bool DecWorker(int count)
+ {
+ if (count <= 0)
+ return false;
+ return true;
+ }
+
+ void DoingWork()
+ {
+ var endTime = GoldRushManager.Instance.GetCampEndTime(GoldRushManager.Instance.selectCampID);
+ if (endTime != 0)
+ return;
+
+ int emptyCnt = GoldRushManager.Instance.GetEmptyWorkerCount();
+ if (emptyCnt == 0 || workerCount > emptyCnt)
+ {
+ SysNotifyMgr.Instance.ShowTip("GoldRush2");
+ return;
+ }
+
+ if (workerCount == 0)
+ {
+ SysNotifyMgr.Instance.ShowTip("GoldRush5");
+ return;
+ }
+
+ if (workerCount > config.WorkerMax)
+ {
+ return;
+ }
+
+ //浠撳簱瀹归噺宸茶揪涓婇檺
+ if (GoldRushManager.Instance.GetWarehouseCnt() >= GoldRushManager.Instance.warehouseMaxCnt)
+ {
+ SysNotifyMgr.Instance.ShowTip("GoldRush3");
+ return;
+ }
+
+ GoldRushManager.Instance.SendGoldRushOP(2, GoldRushManager.Instance.selectCampID, workerCount);
+ CloseWindow();
+ }
+
+ void RefreshItem()
+ {
+ var endTime = GoldRushManager.Instance.GetCampEndTime(GoldRushManager.Instance.selectCampID);
+ if (endTime != 0)
+ return;
+
+
+ if (!UIHelper.CheckMoneyCount(GoldRushManager.Instance.refreshMoneyType, GetRefreshMoney(), 2))
+ {
+ return;
+ }
+
+ GoldRushManager.Instance.SendGoldRushOP(1, GoldRushManager.Instance.selectCampID, 0);
+
+ SysNotifyMgr.Instance.ShowTip("GoldRush4");
+ }
+
+ void CallBackWorker()
+ {
+ var endTime = GoldRushManager.Instance.GetCampEndTime(GoldRushManager.Instance.selectCampID);
+ if (endTime == 0)
+ return;
+
+ var realCnt = GoldRushManager.Instance.GetCampWorkerCnt(GoldRushManager.Instance.selectCampID);
+ if (workerCount == 0)
+ {
+ ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
+ Language.Get("GoldRush38"), (bool isOK) =>
+ {
+ if (isOK)
+ {
+ //鎾ゅ洖鐩戝伐
+ GoldRushManager.Instance.SendGoldRushOP(3, GoldRushManager.Instance.selectCampID, 0);
+ CloseWindow();
+ }
+ });
+ }
+ else if (realCnt == workerCount)
+ {
+ return;
+ }
+ else
+ {
+ //璋冩暣鐩戝伐
+ GoldRushManager.Instance.SendGoldRushOP(2, GoldRushManager.Instance.selectCampID, workerCount);
+ CloseWindow();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/InternalAffairs/GoldRushRefreshWin.cs.meta b/Main/System/InternalAffairs/GoldRushRefreshWin.cs.meta
new file mode 100644
index 0000000..519992d
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushRefreshWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f639ca533ace96b4c9513432ec376a35
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushTentCell.cs b/Main/System/InternalAffairs/GoldRushTentCell.cs
new file mode 100644
index 0000000..02af6b0
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushTentCell.cs
@@ -0,0 +1,578 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening;
+
+//宸ヤ汉鏄浐瀹氱殑璺熼殢妯″紡锛岀洃宸ユ槸闅忔満鍒嗛厤鐨勶紝鍦轰笂鐨勭洃宸ユ暟閲忎細姣斿疄闄呮洿澶�
+//鍒嗛厤鐩戝伐
+// 1.鍒嗛厤閮芥槸鏂扮殑鐩戝伐 涓�瀹氫粠璧风偣寮�濮�
+// 2.鎾ゅ洖鐨勫彲浠ヤ粠鍗婅矾鎾ゅ洖
+public class GoldRushTentCell : MonoBehaviour
+{
+ [SerializeField] Button tentBtn;
+ [SerializeField] GameObject funcGo;
+ [SerializeField] GameObject lockCntGo; //娣橀噾娆℃暟瑙i攣
+ [SerializeField] Text lockCntText;
+ [SerializeField] Button unLockBtn;
+ [SerializeField] GameObject lockMoneyGo;
+ [SerializeField] Button unlockMoneyBtn; //璐у竵瑙i攣
+ [SerializeField] Image unlockMoneyIcon;
+ [SerializeField] Text unlockMoneyText;
+ [SerializeField] GameObject goldRushMissionWaitGo; //鏈彂甯冧换鍔�
+ [SerializeField] GameObject goldRushMissionWorkingGo; //宸插彂甯冧换鍔�
+ [SerializeField] Text goldRushItemText;
+ [SerializeField] Image workingProcess;
+ [SerializeField] UIEffectPlayer refreshItemEffect;
+ [SerializeField] Text workingText; //澶栧嚭涓�
+
+
+ [SerializeField] UIHeroController[] workerArr; //灏忓叺璺熼殢
+ [SerializeField] RectTransform[] workerGoArr;
+ [SerializeField] RectTransform[] hidePosArr; //鏈В閿佹椂 灞忓箷澶栧潗鏍�
+ [SerializeField] RectTransform[] startPosArr; //璧风偣 绔欏矖鍧愭爣
+ [SerializeField] GoldRushPosEvent[] pathPointArr; //绉诲姩鐐�
+ [SerializeField] UIAlphaTween[] wordArr;
+ [SerializeField] Text[] textArr;
+ [SerializeField] GoldRushLeader tmpLeader; //鐩戝伐
+ [SerializeField] Transform leaderParent;
+ [SerializeField] GoldRushPosEvent[] leaderPathPointArr;
+ public int campID = 0;
+
+ //灏忓叺宸ヤ汉
+ Tween[] sequenceArr = new Tween[3];
+ Dictionary<int, int> workerPosDic = new Dictionary<int, int>(); //宸ヤ汉宸茶揪绉诲姩鐐�
+
+ List<GoldRushLeader> workingLeaderList = new List<GoldRushLeader>(); //姝e湪宸ヤ綔鐨勭洃宸� 鍜屽垎閰嶅垪琛ㄤ竴鑷�
+ List<GoldRushLeader> callBackLeaderList = new List<GoldRushLeader>(); //杩旂▼鐨勭洃宸ワ紙瀹屽伐鐨� 鍜� 琚彫鍥炵殑锛�
+ Queue<GoldRushLeader> poolLeaderList = new Queue<GoldRushLeader>(); //鐩戝伐姹�
+
+ int workState = -1; // - 1鏈В閿� 0 绔欏矖 1 鍓嶈繘 2 杩旂▼
+ int leaderCount = 0; //褰撳墠鐩戝伐鏁伴噺
+ void Start()
+ {
+ Init();
+ tentBtn.AddListener(ClickTent);
+ unlockMoneyBtn.AddListener(ClickUnlockMoney);
+ unLockBtn.AddListener(ClickUnlock);
+ }
+
+
+ void OnEnable()
+ {
+ GoldRushManager.Instance.GoldRushEvent += GoldRushEvent;
+ GoldRushManager.Instance.PathEvent += PathEvent;
+ GoldRushManager.Instance.OnGoldRushCampEvent += OnGoldRushCampEvent;
+ GoldRushManager.Instance.OnGoldRushInfoEvent += Display;
+ GoldRushManager.Instance.OnRefreshItemEvent += OnRefreshItemEvent;
+ GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+ leaderCount = GoldRushManager.Instance.GetCampWorkerCnt(campID);
+ Display();
+
+ }
+
+ void OnDisable()
+ {
+ GoldRushManager.Instance.GoldRushEvent -= GoldRushEvent;
+ GoldRushManager.Instance.PathEvent -= PathEvent;
+ GoldRushManager.Instance.OnGoldRushCampEvent -= OnGoldRushCampEvent;
+ GoldRushManager.Instance.OnGoldRushInfoEvent -= Display;
+ GoldRushManager.Instance.OnRefreshItemEvent -= OnRefreshItemEvent;
+ GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+ }
+
+ void FixFollowWoker(int lockState)
+ {
+ //璺熼殢灏忓叺濡傛灉鍦ㄥ鍑轰腑锛屼笖娌℃湁鐩戝伐锛屽垯闅愯棌
+ if (workingLeaderList.Count == 0 && callBackLeaderList.Count == 0 && workState <= 0
+ && GoldRushManager.Instance.GetCampEndTime(campID) != 0)
+ {
+ for (int i = 0; i < workerArr.Length; i++)
+ {
+ workerGoArr[i].localPosition = hidePosArr[i].localPosition;
+ }
+ return;
+ }
+
+ // 鍒濆鐘舵��
+ if (lockState != 0)
+ {
+ //鏈В閿� 鏄剧ず闅愯棌鍧愭爣
+ for (int i = 0; i < workerArr.Length; i++)
+ {
+ workerGoArr[i].localPosition = hidePosArr[i].localPosition;
+ }
+ }
+ else if (workState == -1 && lockState == 0)
+ {
+ //瑙i攣鐨勬椂鍊欙紝濡傛灉涓嶅湪璧风偣鍒欒窇姝ヨ繃鍘�
+ workState = 0;
+ for (int i = 0; i < sequenceArr.Length; i++)
+ {
+ sequenceArr[i].Kill();
+ var worker = workerArr[i];
+ worker.PlayAnimation("run", true, false);
+ sequenceArr[i] = workerGoArr[i].DOLocalMove(startPosArr[i].localPosition, 1f).SetEase(Ease.Linear);
+
+ sequenceArr[i].OnComplete(() =>
+ {
+ worker.PlayAnimation("idle", true, false);
+ });
+ }
+ }
+
+ }
+
+
+ void OnGoldRushCampEvent(int _campID)
+ {
+ if (_campID != campID)
+ return;
+
+ var realCount = GoldRushManager.Instance.GetCampWorkerCnt(campID);
+ if (realCount > leaderCount)
+ {
+ //鍒嗛厤鐩戝伐
+ GoldRushManager.Instance.NotifyGoldRushEvent(campID, 0, realCount - leaderCount);
+ }
+ else if (realCount < leaderCount)
+ {
+ //鍙洖鐩戝伐
+ GoldRushManager.Instance.NotifyGoldRushEvent(campID, 1, leaderCount - realCount);
+ }
+ leaderCount = realCount;
+ Display();
+ }
+
+ void OnRefreshItemEvent(int _campID)
+ {
+ if (_campID != campID)
+ return;
+
+ refreshItemEffect.Play();
+ }
+
+ void Display()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen(GoldRushManager.funcID))
+ {
+ funcGo.SetActive(false);
+ return;
+ }
+ funcGo.SetActive(true);
+
+ var campConfig = GoldRushCampConfig.Get(campID);
+ int lockState = GoldRushManager.Instance.GetCampLockState(campID);
+ if (lockState == 1)
+ {
+ if (GoldRushManager.Instance.panningCnt < campConfig.PanningUnlock)
+ {
+ lockCntGo.SetActive(true);
+ unLockBtn.SetActive(false);
+ lockCntText.text = Language.Get("GoldRush32", GoldRushManager.Instance.panningCnt, campConfig.PanningUnlock);
+ }
+ else
+ {
+ lockCntGo.SetActive(false);
+ unLockBtn.SetActive(true);
+ }
+ lockMoneyGo.SetActive(false);
+ goldRushMissionWaitGo.SetActive(false);
+ goldRushMissionWorkingGo.SetActive(false);
+ }
+ else if (lockState == 2)
+ {
+ lockCntGo.SetActive(false);
+ unLockBtn.SetActive(false);
+ lockMoneyGo.SetActive(true);
+
+ unlockMoneyIcon.SetIconWithMoneyType(campConfig.MoneyUnlock[0]);
+ unlockMoneyText.text = campConfig.MoneyUnlock[1].ToString();
+ goldRushMissionWaitGo.SetActive(false);
+ goldRushMissionWorkingGo.SetActive(false);
+ }
+ else
+ {
+ lockCntGo.SetActive(false);
+ unLockBtn.SetActive(false);
+ lockMoneyGo.SetActive(false);
+ var goldID = GoldRushManager.Instance.GetCampGoldID(campID);
+ if (goldID == 0)
+ {
+ goldRushMissionWaitGo.SetActive(true);
+ goldRushMissionWorkingGo.SetActive(false);
+ }
+ else
+ {
+ goldRushMissionWaitGo.SetActive(false);
+ goldRushMissionWorkingGo.SetActive(true);
+ var goldConfig = GoldRushItemConfig.Get(goldID);
+ goldRushItemText.text = GoldRushManager.Instance.GetCampItemName(goldConfig);
+
+ var endTime = GoldRushManager.Instance.GetCampEndTime(campID);
+ if (endTime == 0)
+ {
+ //鏈紑濮�
+ workingText.text = "";
+ workingProcess.fillAmount = 0;
+ }
+ else
+ {
+ //鎸夊師鎬绘椂闀垮綋杩涘害鏉�
+ workingProcess.fillAmount = (goldConfig.NeedSeconds - (GoldRushManager.Instance.GetCampEndTime(campID) - TimeUtility.AllSeconds)) / (float)goldConfig.NeedSeconds;
+ }
+
+ }
+ }
+
+ FixFollowWoker(lockState);
+ }
+
+ void OnSecondEvent()
+ {
+ //杩涘害鏉″拰 澶栧嚭涓枃瀛�
+ int lockState = GoldRushManager.Instance.GetCampLockState(campID);
+ if (lockState != 0)
+ {
+ return;
+ }
+ var goldID = GoldRushManager.Instance.GetCampGoldID(campID);
+ if (goldID == 0)
+ {
+ return;
+ }
+ var endTime = GoldRushManager.Instance.GetCampEndTime(campID);
+ if (endTime == 0)
+ {
+ return;
+ }
+
+ var addStr = new string('.', (int)Time.time % 4);
+ workingText.text = Language.Get("GoldRush37") + addStr;
+ var goldConfig = GoldRushItemConfig.Get(goldID);
+ //鎸夊師鎬绘椂闀垮綋杩涘害鏉�
+ workingProcess.fillAmount = (goldConfig.NeedSeconds - (GoldRushManager.Instance.GetCampEndTime(campID) - TimeUtility.AllSeconds)) / (float)goldConfig.NeedSeconds;
+
+ }
+
+ void GoldRushEvent(int _campID, int eventType, int leaderCount)
+ {
+ if (_campID != campID)
+ {
+ return;
+ }
+ if (eventType == 0)
+ {
+ //鍑哄彂
+ AssignLeader(leaderCount);
+ }
+ else if (eventType == 1)
+ {
+ //杩旂▼
+ CallBackLeader(leaderCount);
+ }
+ }
+
+
+
+ void Init()
+ {
+ for (int i = 0; i < workerArr.Length; i++)
+ {
+ workerPosDic[i] = -1; //-1浠h〃璧风偣锛岀珯宀楀潗鏍�
+ wordArr[i].SetEndState();
+ }
+ }
+
+ public void StartMove(bool isBack)
+ {
+ for (int i = 0; i < sequenceArr.Length; i++)
+ {
+ sequenceArr[i].Kill();
+ WorkerMove(isBack, i);
+ }
+
+ }
+
+ void WorkerMove(bool isBack, int workerIndex)
+ {
+ var worker = workerArr[workerIndex];
+ var workerGo = workerGoArr[workerIndex];
+ int curIndex = workerPosDic[workerIndex];
+ int moveIndex = isBack ? curIndex - 1 : curIndex + 1;
+
+
+ GoldRushPosEvent pathPosEvent = isBack ? pathPointArr[curIndex] : pathPointArr[moveIndex]; //鍒ゆ柇浜嬩欢, 褰撳墠鐐规垨鑰呬笅涓�涓偣
+
+ Vector3 nextPos;
+ if (moveIndex <= -1)
+ {
+ moveIndex = -1;
+ nextPos = startPosArr[workerIndex].localPosition;
+ }
+ else
+ {
+ if (moveIndex >= pathPointArr.Length)
+ {
+ moveIndex = pathPointArr.Length - 1;
+ }
+ nextPos = pathPointArr[moveIndex].transform.localPosition;
+ }
+ worker.PlayAnimation("run", true, false);
+
+ workerPosDic[workerIndex] = moveIndex;
+ bool isRush = pathPosEvent.m_PosEvent == PosEvent.Rush;
+ bool isJump = pathPosEvent.m_PosEvent == PosEvent.Jump;
+
+ worker.SetSpeed((isRush ? 2 : 1) * (isBack ? 0.5f : 1));
+
+ // 鍏堝嚭鍙戠殑缁堢偣瑕佸線鍓嶄竴鐐�
+ Vector3 offset = Vector3.zero;
+ if (moveIndex == pathPointArr.Length - 1)
+ {
+ offset = new Vector3((pathPointArr.Length - workerIndex - 1) * 80, 0, 0);
+ }
+ var endPos = nextPos - offset;
+
+ var dis = Vector3.Distance(workerGo.localPosition, endPos);
+ var duration = dis / pathPosEvent.m_Speed / (isBack ? pathPosEvent.m_BackSlowSpeedScale : 1);
+
+ // Debug.Log("绗�" + workerIndex + "涓伐浜�" + " duration" + duration + " 绉诲姩index " + moveIndex + " Time=" + Time.time);
+ if (workerGo.localPosition.x < endPos.x)
+ {
+ worker.transform.localRotation = Quaternion.Euler(0, 0, 0);
+ }
+ else
+ {
+ //杞悜
+ worker.transform.localRotation = Quaternion.Euler(0, 180, 0);
+ }
+ if (!isJump)
+ {
+ sequenceArr[workerIndex] = workerGo.DOLocalMove(endPos, duration).SetEase(pathPosEvent.m_EaseType);
+ }
+ else
+ {
+ //鎶涚墿绾胯烦璺�
+ // 璁$畻鎶涚墿绾胯矾寰勭偣
+ Vector3[] path = new Vector3[3];
+ path[0] = workerGo.localPosition; // 璧风偣
+ //椤剁偣x 鏄袱鑰呬箣闂� y澧炲姞楂樺害
+ path[1] = new Vector3(endPos[0] + (workerGo.localPosition.x - endPos[0]) / 2, endPos[1] + pathPosEvent.m_Value1, nextPos.z);
+ path[2] = endPos; // 缁堢偣
+
+ // 浣跨敤 DOPath 瀹炵幇鎶涚墿绾跨Щ鍔�
+ sequenceArr[workerIndex] = workerGo.DOLocalPath(path, pathPosEvent.m_Value2, PathType.CatmullRom).SetEase(pathPosEvent.m_EaseType);
+ }
+ sequenceArr[workerIndex].OnComplete(() =>
+ {
+ // Debug.Log("Sequence completed for worker " + workerIndex);
+ if (moveIndex == (isBack ? -1 : pathPointArr.Length - 1))
+ {
+ worker.PlayAnimation("idle", true, false);
+ worker.transform.localRotation = Quaternion.Euler(0, 0, 0);
+ if (moveIndex == -1)
+ {
+ workState = 0;
+ }
+ return;
+ }
+
+ WorkerMove(isBack, workerIndex);
+ });
+
+ }
+
+
+
+ void PathEvent(PosEvent posEvent, bool isBack, int _tendID, int index, string content)
+ {
+ if (_tendID != campID)
+ return;
+
+ if (posEvent == PosEvent.TargetFollow)
+ {
+ if (isBack)
+ return;
+ // 宸茬粡鍦ㄥ鍑轰腑涓嶈窡闅�
+ if (workState == 1)
+ return;
+ StartMove(false);
+ workState = 1;
+ }
+
+ else if (posEvent == PosEvent.TargetWord)
+ {
+ wordArr[index].SetActive(true);
+ wordArr[index].Play();
+ textArr[index].text = Language.Get(content);
+ }
+ else if (posEvent == PosEvent.TargetAction)
+ {
+ for (int i = 0; i < wordArr.Length; i++)
+ {
+ workerArr[i].PlayAnimation(content);
+ }
+ }
+
+ }
+
+
+
+
+
+ void AssignLeader(int addCount)
+ {
+ //鍒嗛厤鐨勬椂鍊欏姞鏂扮殑鐩戝伐
+ for (int i = 0; i < addCount; i++)
+ {
+ float waitTime = i * 0.6f;
+ var newLeader = RequestLeader();
+ workingLeaderList.Add(newLeader);
+ newLeader.Init(leaderPathPointArr, waitTime, campID, false, (bool value) =>
+ {
+ if (!value)
+ {
+ workingLeaderList.Remove(newLeader);
+ ReturnLeader(newLeader);
+ }
+ else
+ {
+ //鍗婅矾杩斿洖鐨勭洃宸�
+ callBackLeaderList.Add(newLeader);
+ ReturnLeader(newLeader);
+ }
+ });
+ }
+ }
+
+ GoldRushLeader RequestLeader()
+ {
+ if (poolLeaderList.Count == 0)
+ {
+ return Instantiate(tmpLeader, leaderParent);
+ }
+ return poolLeaderList.Dequeue();
+ }
+
+ void ReturnLeader(GoldRushLeader leader)
+ {
+ poolLeaderList.Enqueue(leader);
+ }
+
+
+ //鍗婅矾鍙洖鐨勶紝鎷夎揣鍥炴潵鐨�
+ void CallBackLeader(int callBackCount)
+ {
+ bool followBack = false;
+ //浠巜orkingLeaderList 涓彇鍑烘渶鍚庨潰璋冨洖鐨勭洃宸ワ紝涓嶅鐨勬柊寤�
+ for (int i = 0; i < callBackCount; i++)
+ {
+ if (workingLeaderList.Count > 0)
+ {
+ //鍗婅矾鎷夊洖鏉ョ殑
+ var leader = workingLeaderList[workingLeaderList.Count - 1];
+ //鍘熸牱鏄剧ず
+ callBackLeaderList.Add(leader);
+ workingLeaderList.Remove(leader);
+ leader.StartLeaderMove(true);
+ if (workingLeaderList.Count == 0 && workState == 1)
+ {
+ followBack = true;
+ }
+ }
+ else
+ {
+ //闇�瑕佹樉绀鸿揣鐗�
+ float waitTime = i * 0.6f;
+ var newLeader = RequestLeader();
+ callBackLeaderList.Add(newLeader);
+ newLeader.Init(leaderPathPointArr, waitTime, campID, true, (bool value) =>
+ {
+ if (value)
+ {
+ //杩斿洖鐨勭洃宸ワ紝闇�瑕佹樉绀鸿揣鐗�
+ callBackLeaderList.Add(newLeader);
+ ReturnLeader(newLeader);
+ }
+ });
+ if (workingLeaderList.Count == 0 && workState == 1)
+ {
+ followBack = true;
+ }
+ }
+ }
+
+ if (followBack)
+ {
+ StartMove(true);
+ workState = 2;
+ }
+ }
+
+ void ClickTent()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen(GoldRushManager.funcID))
+ {
+ return;
+ }
+ var lockState = GoldRushManager.Instance.GetCampLockState(campID);
+ if (lockState != 0)
+ {
+ return;
+ }
+ var goldID = GoldRushManager.Instance.GetCampGoldID(campID);
+ if (goldID != 0)
+ {
+ GoldRushManager.Instance.selectCampID = campID;
+ UIManager.Instance.OpenWindow<GoldRushRefreshWin>();
+ return;
+ }
+
+ if (!UIHelper.CheckMoneyCount(52, 1, 1))
+ {
+ return;
+ }
+
+ GoldRushManager.Instance.SendGoldRushOP(0, campID, 0);
+ }
+
+ void ClickUnlockMoney()
+ {
+ int lockState = GoldRushManager.Instance.GetCampLockState(campID);
+ if (lockState != 2)
+ {
+ return;
+ }
+ var config = GoldRushCampConfig.Get(campID);
+
+ ConfirmCancel.MoneyIconToggleConfirmByType(ToggleCheckType.GoldRush, config.MoneyUnlock[1], config.MoneyUnlock[0],
+ Language.Get("GoldRush35", UIHelper.GetIconNameWithMoneyType(config.MoneyUnlock[0]), config.MoneyUnlock[1]), () =>
+ {
+ if (!UIHelper.CheckMoneyCount(config.MoneyUnlock[0], config.MoneyUnlock[1], 2))
+ {
+ return;
+ }
+ GoldRushManager.Instance.SendGoldRushUnlock(0, campID);
+ refreshItemEffect.Play();
+ });
+
+
+ }
+
+ //杈惧埌鍙В閿佹潯浠� 闇�鎵嬪姩瑙i攣
+ void ClickUnlock()
+ {
+ int lockState = GoldRushManager.Instance.GetCampLockState(campID);
+ if (lockState != 1)
+ {
+ return;
+ }
+ var config = GoldRushCampConfig.Get(campID);
+ if (GoldRushManager.Instance.panningCnt < config.PanningUnlock)
+ return;
+
+ GoldRushManager.Instance.SendGoldRushUnlock(0, campID);
+ refreshItemEffect.Play();
+ }
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushTentCell.cs.meta b/Main/System/InternalAffairs/GoldRushTentCell.cs.meta
new file mode 100644
index 0000000..10eb609
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushTentCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: aa12fac436eef3a458155d427ae5ad4e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushWorkCell.cs b/Main/System/InternalAffairs/GoldRushWorkCell.cs
new file mode 100644
index 0000000..c2c4056
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushWorkCell.cs
@@ -0,0 +1,18 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+//娣橀噾涓俊鎭垪琛ㄦ樉绀�
+public class GoldRushWorkCell : CellView
+{
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Text nameText;
+ [SerializeField] Text timeText;
+ [SerializeField] Slider slider;
+ [SerializeField] CountControler countControler;
+
+
+
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushWorkCell.cs.meta b/Main/System/InternalAffairs/GoldRushWorkCell.cs.meta
new file mode 100644
index 0000000..803d3f0
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushWorkCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6bef7211ba539124a8039c45117dbcfb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushWorkerCell.cs b/Main/System/InternalAffairs/GoldRushWorkerCell.cs
new file mode 100644
index 0000000..79494b4
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushWorkerCell.cs
@@ -0,0 +1,14 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+//娣橀噾宸ヤ汉鐨勫垪琛ㄦ樉绀�
+public class GoldRushWorkerCell : CellView
+{
+ [SerializeField] Button tentBtn;
+
+
+
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushWorkerCell.cs.meta b/Main/System/InternalAffairs/GoldRushWorkerCell.cs.meta
new file mode 100644
index 0000000..651d521
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushWorkerCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6ce961bc85dcad74c89a295e6d8c4cd4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/InternalAffairs/GoldRushWorkerWin.cs b/Main/System/InternalAffairs/GoldRushWorkerWin.cs
new file mode 100644
index 0000000..ff26db3
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushWorkerWin.cs
@@ -0,0 +1,94 @@
+using System;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 娣橀噾娲鹃仯鎬荤鐞�
+/// </summary>
+public class GoldRushWorkerWin : UIBase
+{
+ [SerializeField] GroupButtonEx workMgrBtn; //娲鹃仯绠$悊
+ [SerializeField] GroupButtonEx workersBtn; //鐩戝伐浜哄憳绠$悊
+
+ [SerializeField] Transform workMgrRect;
+ [SerializeField] Transform workersRect;
+
+ //娲鹃仯绠$悊
+ [SerializeField] ScrollerController workMgrScroller;
+ [SerializeField] Transform workMgrEmpty;
+ [SerializeField] Text lazyWorkerCntText; //绌洪棽鐩戝伐鏁伴噺
+ [SerializeField] Text warehouseCntText; //浠撳簱鏁伴噺
+ [SerializeField] Button getAllAwardBtn;
+
+ //鐩戝伐浜哄憳绠$悊
+ [SerializeField] ScrollerController workersScroller;
+ [SerializeField] Text unlockWorkerCntText; //瑙i攣鐩戝伐鏁伴噺
+ [SerializeField] Text totalWorkFinishCount; //娣橀噾瀹屾垚鎬绘鏁�
+
+
+ protected override void InitComponent()
+ {
+ workMgrBtn.AddListener(OnWorkMgrBtnClick);
+ workersBtn.AddListener(OnWorkerBtnClick);
+ }
+
+
+
+ protected override void OnPreOpen()
+ {
+
+ if (functionOrder == 0)
+ {
+ workMgrBtn.SelectBtn();
+ }
+ else
+ {
+ workersBtn.SelectBtn();
+ }
+ Display();
+ }
+
+ protected override void OnPreClose()
+ {
+ }
+
+
+ void Display()
+ {
+ if (functionOrder == 0)
+ {
+ DispalyWorkMgr();
+ }
+ else
+ {
+ DispalyWorkers();
+ }
+ }
+
+ void DispalyWorkMgr()
+ {
+ workMgrRect.SetActive(true);
+ workersRect.SetActive(false);
+ }
+
+ void DispalyWorkers()
+ {
+ workMgrRect.SetActive(false);
+ workersRect.SetActive(true);
+ }
+
+ void OnWorkMgrBtnClick()
+ {
+ functionOrder = 0;
+ Display();
+ }
+
+ void OnWorkerBtnClick()
+ {
+ functionOrder = 1;
+ Display();
+ }
+
+}
\ No newline at end of file
diff --git a/Main/System/InternalAffairs/GoldRushWorkerWin.cs.meta b/Main/System/InternalAffairs/GoldRushWorkerWin.cs.meta
new file mode 100644
index 0000000..b5345cc
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushWorkerWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: aaf329a6e30c71f4c973aa257e265e8b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ItemTip/ItemTipUtility.cs b/Main/System/ItemTip/ItemTipUtility.cs
index 6a5e647..fc652e9 100644
--- a/Main/System/ItemTip/ItemTipUtility.cs
+++ b/Main/System/ItemTip/ItemTipUtility.cs
@@ -223,11 +223,11 @@
public static TipData mainTipData { get; private set; } // 娉ㄦ剰褰撻�掕繘鐐瑰嚮鎵撳紑澶氫釜tip鐣岄潰浼氬彉鏇存暟鎹紝涓嶈兘渚濊禆姝ゅ��
public static TipData secondaryData { get; private set; }
- public static void ShowMoneyTip(int moneyType)
+ public static void ShowMoneyTip(int moneyType, bool showGetWay = true)
{
if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
{
- Show(GeneralDefine.MoneyDisplayModel[moneyType], true);
+ Show(GeneralDefine.MoneyDisplayModel[moneyType], showGetWay);
}
else
{
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
index 7ede547..915f6f3 100644
--- a/Main/System/KnapSack/Logic/ItemLogicUtility.cs
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -296,32 +296,7 @@
return isEnough;
}
- /// <param name="needTips">0 涓嶅搷搴� 1 寮规彁绀� 2 寮硅幏鍙栭�斿緞tips</param>
- public static bool CheckCurrencyCount(int moneyType, long needCount, int needTips = 0)
- {
- if (needCount <= 0)
- {
- return true;
- }
-
- long haveCount = UIHelper.GetMoneyCnt(moneyType);
-
- bool isEnough = haveCount >= needCount;
-
- if (!isEnough)
- {
- if (needTips == 1)
- {
- SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
- }
- else if (needTips == 2)
- {
- ItemTipUtility.ShowMoneyTip(moneyType);
- }
- }
-
- return isEnough;
- }
+
public event Action<string> GetBetterEquipEvent; //寰楀埌鏇村ソ鐨勮澶� value 鐗╁搧鐨勫疄渚婭D
diff --git a/Main/System/Main/AutoFightModel.cs b/Main/System/Main/AutoFightModel.cs
index 0eb4c3a..d4387c2 100644
--- a/Main/System/Main/AutoFightModel.cs
+++ b/Main/System/Main/AutoFightModel.cs
@@ -184,7 +184,7 @@
return;
}
- if (!ItemLogicUtility.CheckCurrencyCount(41, PlayerDatas.Instance.baseData.UseHarmerCount, 2))
+ if (!UIHelper.CheckMoneyCount(41, PlayerDatas.Instance.baseData.UseHarmerCount, 2))
{
if (storyBattleField.GetBattleMode() != BattleMode.Stop)
storyBattleField.HaveRest();
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index 4bcb172..08cdb4b 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -82,10 +82,10 @@
public readonly Redpoint fairyActivityRedpoint = new Redpoint(218);
#endregion
- public static int BlessLVRedpoint = 399; //绁濈绛夌骇绾㈢偣
- public static int DailySpecialsRedpoint = 439; //姣忔棩鐗规儬鍏ュ彛绾㈢偣
+ public const int BlessLVRedpoint = 399; //绁濈绛夌骇绾㈢偣
+ public const int DailySpecialsRedpoint = 439; //姣忔棩鐗规儬鍏ュ彛绾㈢偣
- public static int BlessedLandRedpoint = 444; //绂忓湴绾㈢偣
+ public const int BlessedLandRedpoint = 444; //娣橀噾绾㈢偣
public const int CustomizedGiftRedpoint = 448; //鑷�夌ぜ鍖�
public const int LoginZhanLingRedpoint = 449; //鐧诲綍鎴樹护
public const int PhantasmPavilionRepoint = 459; //骞诲闃�
diff --git a/Main/System/Tip/ConfirmCancel.cs b/Main/System/Tip/ConfirmCancel.cs
index 9a214a9..58b15e0 100644
--- a/Main/System/Tip/ConfirmCancel.cs
+++ b/Main/System/Tip/ConfirmCancel.cs
@@ -257,6 +257,9 @@
public static string generalItemTip;
public static string generalItemTip2;
+ public static int moneyType;
+ public static int moneyNeedCount;
+
public static List<Item> getItems { get; private set; }
public static string replaceItemName;
/// <summary>
@@ -289,36 +292,42 @@
}
+ public static void MoneyIconToggleConfirmByType(ToggleCheckType type, int moneyCnt, int _moneyType, string fullTip, Action func)
+ {
+ if (toggleCheckDict.ContainsKey(type) && toggleCheckDict[type])
+ {
+ func?.Invoke();
+ return;
+ }
- public static string moneyTitle;
- public static string moneyTopInfo;
- public static string moneybtnOkText;
- public static int moneyType;
- public static int moneyNeedCount;
- public static ulong moneyHaveCount;
- public static string moneyToggleText { get; private set; }
- public static bool moneytoggleOpen { get; private set; }
- public static bool moneytoggleOpenState { get; private set; }
+ MoneyIconToggleConfirm(moneyCnt, _moneyType, fullTip, Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
+ {
+ if (isOk)
+ {
+ func?.Invoke();
+ toggleCheckDict[type] = isToggle;
+ }
- // public static Action<bool, bool> OnMoneyToggleConfirmAct;
- // public static void MoneyIconToggleConfirm(string title, string topInfo,string okTxt, int type,
- // int needCnt, ulong haveCnt, Action<bool, bool> func, bool toggleOpen = false, string toggleTxt = "", bool toggleOpenState = false)
- // {
- // moneyTitle = title;
- // moneyTopInfo = topInfo;
- // moneybtnOkText = okTxt;
- // moneyType = type;
- // moneyNeedCount = needCnt;
- // moneyHaveCount = haveCnt;
- // moneyToggleText = toggleTxt;
- // moneytoggleOpen = toggleOpen;
- // moneytoggleOpenState = toggleOpenState;
- // OnMoneyToggleConfirmAct = func;
- // if (!UIManager.Instance.IsOpened<MoneyIconToggleConfirmWin>())
- // {
- // UIManager.Instance.OpenWindow<MoneyIconToggleConfirmWin>();
- // }
- // }
+ });
+ }
+
+
+
+
+ public static Action<bool, bool> OnMoneyToggleConfirmAct;
+ public static void MoneyIconToggleConfirm(int moneyCnt, int _moneyType, string content, string toggleTxt, Action<bool, bool> func, bool _toggle = false)
+ {
+ generalContent = content;
+ toggleContent = toggleTxt;
+ OnToggleConfirmEvent = func;
+ toggleOpenState = _toggle;
+ moneyType = _moneyType;
+ moneyNeedCount = moneyCnt;
+ if (!UIManager.Instance.IsOpened<MoneyIconToggleConfirmWin>())
+ {
+ UIManager.Instance.OpenWindow<MoneyIconToggleConfirmWin>();
+ }
+ }
}
@@ -326,6 +335,7 @@
{
Auction = 0, //鎷嶅崠琛�
WashCancel = 1, //娲楃粌鍙栨秷
+ GoldRush = 2, //娣橀噾
}
diff --git a/Main/System/Tip/MoneyIconToggleConfirmWin.cs b/Main/System/Tip/MoneyIconToggleConfirmWin.cs
new file mode 100644
index 0000000..cc580c7
--- /dev/null
+++ b/Main/System/Tip/MoneyIconToggleConfirmWin.cs
@@ -0,0 +1,71 @@
+锘�/*
+ * @Author: 鐜╀釜娓告垙
+ * @Date: 2025-09-25 15:16:21
+ */
+
+using UnityEngine;
+using UnityEngine.UI;
+
+// 鏄剧ず璐у竵鐨勫嬀閫夌‘璁ゆ锛屾寜閽爣棰樼瓑淇℃伅闇�瑕佹洿鏀圭殑璇� 鍚庣画琛ュ厖
+public class MoneyIconToggleConfirmWin : UIBase
+{
+ [SerializeField] Text m_Content;
+ [SerializeField] Text m_ToggleTxt;
+ [SerializeField] Toggle m_Toggle;
+ [SerializeField] Button m_ConfirmBtn;
+ [SerializeField] Button m_CancelBtn;
+ [SerializeField] Text moneyText;
+ [SerializeField] Image moneyIcon;
+ protected override void InitComponent()
+ {
+ m_ConfirmBtn.AddListener(OnConfirm);
+ m_CancelBtn.AddListener(OnCancel);
+ }
+
+ protected override void OnPreOpen()
+ {
+ m_Content.text = ConfirmCancel.generalContent;
+ m_ToggleTxt.text = ConfirmCancel.toggleContent;
+ m_Toggle.isOn = ConfirmCancel.toggleOpenState;
+
+ moneyText.text = UIHelper.ShowUseMoney(ConfirmCancel.moneyType, ConfirmCancel.moneyNeedCount);
+ moneyIcon.SetIconWithMoneyType(ConfirmCancel.moneyType);
+ // m_CancelBtn.SetActive(ConfirmCancel.OnToggleConfirmEvent != null);
+
+ // if (string.IsNullOrEmpty(ConfirmCancel.OKName))
+ // (m_ConfirmBtn.FindComponent("Text", "Text") as Text).text = Language.Get("PopConfirmWin_OK");
+ // else
+ // (m_ConfirmBtn.FindComponent("Text", "Text") as Text).text = ConfirmCancel.OKName;
+ // if (string.IsNullOrEmpty(ConfirmCancel.CancelName))
+ // (m_CancelBtn.FindComponent("Text", "Text") as Text).text = Language.Get("PopConfirmWin_Cancel");
+ // else
+ // (m_CancelBtn.FindComponent("Text", "Text") as Text).text = ConfirmCancel.CancelName;
+ }
+
+
+ private void OnConfirm()
+ {
+ CloseWindow();
+ if (ConfirmCancel.OnToggleConfirmEvent != null)
+ {
+ ConfirmCancel.OnToggleConfirmEvent(true, m_Toggle.isOn);
+ }
+ }
+
+ private void OnCancel()
+ {
+ CloseWindow();
+ if (ConfirmCancel.OnToggleConfirmEvent != null)
+ {
+ ConfirmCancel.OnToggleConfirmEvent(false, m_Toggle.isOn);
+ }
+
+ }
+
+
+}
+
+
+
+
+
diff --git a/Main/System/Tip/MoneyIconToggleConfirmWin.cs.meta b/Main/System/Tip/MoneyIconToggleConfirmWin.cs.meta
new file mode 100644
index 0000000..5bfcdc9
--- /dev/null
+++ b/Main/System/Tip/MoneyIconToggleConfirmWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 95ac88de84302544494ab3dac52375ef
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Tip/ToggleConfirmWin.cs b/Main/System/Tip/ToggleConfirmWin.cs
index dc97505..0162b99 100644
--- a/Main/System/Tip/ToggleConfirmWin.cs
+++ b/Main/System/Tip/ToggleConfirmWin.cs
@@ -46,17 +46,6 @@
(m_CancelBtn.FindComponent("Text", "Text") as Text).text = ConfirmCancel.CancelName;
}
- protected override void OnOpen()
- {
- }
-
- protected override void OnPreClose()
- {
- }
-
- protected override void OnClose()
- {
- }
private void OnConfirm()
{
CloseWindow();
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 8b7664c..7d02704 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -709,12 +709,7 @@
default42, // 270 浠欑紭绉垎
default43, // 271 骞诲闃佺Н鍒�
default44, // 272 姝﹀皢鎷涘嫙绉垎
- default45,
- default46,
- default47,
- default48,
- default49,
- default50,
+ GoldRush = 285, // 娣橀噾浠�
};
diff --git a/Main/Utility/TimeUtility.cs b/Main/Utility/TimeUtility.cs
index e49d754..c172af2 100644
--- a/Main/Utility/TimeUtility.cs
+++ b/Main/Utility/TimeUtility.cs
@@ -89,7 +89,7 @@
public static readonly DateTime OriginalTime = new DateTime(1970, 1, 1, 8, 0, 0);
public static readonly DateTime ClientOriginalTime = new DateTime(1, 1, 1, 0, 0, 0);
/// <summary>
- /// 鏈嶅姟鍣ㄦ椂闂寸浉姣旇捣濮嬫椂闂寸殑绉掓暟(涓昏鏂逛究姣旇緝)
+ /// 鏈嶅姟鍣ㄦ椂闂寸浉姣旇捣濮嬫椂闂寸殑绉掓暟(鍗虫湇鍔″櫒鐨勬椂闂存埑)
/// </summary>
public static int AllSeconds
{
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 55bf242..6757b45 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -69,14 +69,15 @@
public static void SetIconWithMoneyType(this Image _image, int moneyType)
{
if (_image == null) return;
- // string iconKey = StringUtility.Contact("Money_Type_", moneyType);
if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType))
{
_image.SetOrgSprite(ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey);
}
else
{
- Debug.LogError("MoneyDisplayModel 涓洪厤缃揣甯佺被鍨嬶細" + moneyType);
+ // 涓嶉渶瑕佺墿鍝佺殑鎯呭喌琛ュ厖
+ // string iconKey = StringUtility.Contact("Money_Type_", moneyType);
+ Debug.LogError("MoneyDisplayModel 鏈厤缃揣甯佺被鍨嬶細" + moneyType);
}
}
@@ -1105,6 +1106,11 @@
//姝﹀皢鎷涘嫙绉垎
return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.default44);
}
+ case 52:
+ {
+ //娣橀噾浠�
+ return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.GoldRush);
+ }
case 98:
{
//杩囨湡鍨嬩唬閲戝埜
@@ -1138,6 +1144,35 @@
return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}");
}
+
+ /// <param name="needTips">0 涓嶅搷搴� 1 寮规彁绀� 2 寮硅幏鍙栭�斿緞tips</param>
+ public static bool CheckMoneyCount(int moneyType, long needCount, int needTips = 0)
+ {
+ if (needCount <= 0)
+ {
+ return true;
+ }
+
+ long haveCount = GetMoneyCnt(moneyType);
+
+ bool isEnough = haveCount >= needCount;
+
+ if (!isEnough)
+ {
+ if (needTips == 1)
+ {
+ SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType);
+ }
+ else if (needTips == 2)
+ {
+ ItemTipUtility.ShowMoneyTip(moneyType);
+ }
+ }
+
+ return isEnough;
+ }
+
+
#endregion
#region 寰楀埌瑁呭浣嶆垨鑰呯绂忔爲鍝佽川鍚嶇О 甯﹂鑹�
--
Gitblit v1.8.0