Core/MapEditor/Behavior/Bhv_MapData.cs
@@ -28,6 +28,33 @@ public const string NodeName_Event = "Event_"; public const string NodeName_Transfer = "Transfer_"; private int m_TriggerSeed; private int m_EventSeed; public int GetTriggerSeed() { return m_TriggerSeed; } public int GetEventSeed() { return m_EventSeed; } public int RequestTriggerID() { return m_TriggerSeed++; } public int RequestEventID() { return m_EventSeed++; } public void SetTriggerID(int id) { m_TriggerSeed = id; } public void SetEventID(int id) { m_EventSeed = id; } public void Save(BinaryWriter bw) { bw.Write(id); Core/MapEditor/Data/Event/Evt_RefreshMonster.cs
@@ -51,37 +51,5 @@ monsters[i].Load(br); } } /* float delay = Time.now float interval int index update if refreshType == all for index = 0; index < monsters.Length; ++index doRefresh(monsters[index]); else if refreshType == onebyoneTime if Time.now - delay > interval doRefresh(monster[index]); index++; delay = Time.now; else if refreshType == onebyoneDie if prevNpc.isDie prevNpc = doRefresh(monster[index]); index++; int deadCount float overTime = conditionParam * 0.001f; float timePast = Time.now over if condition == None return true; else if condition == DeadCount return deadCount > monsters.Length || deadCount > conditionParam; else if condition == Time return Time.now - timePast >= overTime; */ } } Core/MapEditor/Editor/MapEditor.cs
@@ -10,18 +10,6 @@ private string LS_KEY_SAVEPATH; private string LS_KEY_EXPORTPATH; private int m_TriggerSeed; private int m_EventSeed; private int m_TransferSeed; private int RequestTriggerID() { return m_TriggerSeed++; } private int RequestEventID() { return m_EventSeed++; } private Evt.E_EventType eventType = Evt.E_EventType.Enemy; [MenuItem("程序/MapEditor | 地图编辑器")] @@ -52,6 +40,7 @@ _root.AddComponent<MeshCollider>(); _root.transform.position = _go.transform.position; _root.transform.rotation = _go.transform.rotation; _root.transform.localScale = _go.transform.localScale; _root.layer = LayerUtility.Walkble; break; } @@ -85,11 +74,7 @@ { if (GUILayout.Button("测试")) { var m = MapData.LoadFormFile(10120); if (m == null) { Debug.Log("加载失败"); } ClientSceneManager.Instance.TriggerTest(8); } if (gUISkin == null) { @@ -269,7 +254,7 @@ private void CreateTrigger() { var _mapData = target as Bhv_MapData; var _id = RequestTriggerID(); var _id = _mapData.RequestTriggerID(); var _trigger = CreateNewGO(Bhv_MapData.NodeName_Trigger + _id); var _triggerBhv = _trigger.AddComponent<Bhv_MapTrigger>(); _triggerBhv.id = _id; @@ -284,7 +269,7 @@ if (type == Evt.E_EventType.Enemy) { int _id = RequestEventID(); int _id = _mapData.RequestEventID(); var _event = CreateNewGO(Bhv_MapData.NodeName_Event + "RefreshEvemy_" + _id); var _eventBhv = _event.AddComponent<Bhv_Evt_RefreshMonster>(); _eventBhv.id = _id; @@ -296,7 +281,7 @@ } else if (type == Evt.E_EventType.SceneObject) { int _id = RequestEventID(); int _id = _mapData.RequestEventID(); var _event = CreateNewGO(Bhv_MapData.NodeName_Event + "RefreshSceneObject_" + _id); var _eventBhv = _event.AddComponent<Bhv_Evt_RefreshSceneObject>(); _eventBhv.id = _id; @@ -374,19 +359,20 @@ _mapData.Load(_binaryReader); EditorPrefs.SetString(LS_KEY_SAVEPATH, Directory.GetParent(_path).FullName); foreach (var _event in _mapData.eventList) { if (_event.id >= m_EventSeed) if (_event.id >= _mapData.GetEventSeed()) { m_EventSeed = _event.id + 1; _mapData.SetEventID(_event.id + 1); } } foreach (var _trigger in _mapData.triggerList) { if (_trigger.id >= m_TriggerSeed) if (_trigger.id >= _mapData.GetTriggerSeed()) { m_TriggerSeed = _trigger.id + 1; _mapData.SetTriggerID(_trigger.id + 1); } } } Fight/Actor/HeroBehaviour.cs
@@ -903,7 +903,7 @@ if (_clientNpc != null && _clientNpc.belongEventID != -1) { ClientSceneManager.Instance.NpcDead(_clientNpc.belongEventID, _clientNpc); ClientSceneManager.Instance.NpcDead(_clientNpc.belongEventID, _clientNpc, _clientNpc.NpcConfig.NPCID); } // 前期战斗只发送石头人的 //if (1000 == _target.NpcConfig.NPCID) Fight/GameActor/GAMgr.cs
@@ -677,11 +677,15 @@ case E_ActorClassType.NpcClientFunc: _actor = new GA_NpcClientFunc(); break; case E_ActorClassType.NpcCollect: _actor = new GA_NpcClientCollect(); break; } } if (_actor != null) { _actor.InitNpcConfig((int)npcID); _actor.Init(serverInstID, m_ClientId.Request(), group, null); BuildManagerRelation(_actor, _actorClassType); @@ -1376,6 +1380,10 @@ { return (byte)E_ActorClassType.PVPClientPlayer; } else if (_type == typeof(GA_NpcClientCollect)) { return (byte)E_ActorClassType.NpcCollect; } return (byte)E_ActorClassType.UnDefine; } Fight/GameActor/GA_NpcClientCollect.cs
New file @@ -0,0 +1,269 @@ using System; using System.Collections.Generic; using Snxxz.UI; using UnityEngine; using UnityEngine.Events; public class GA_NpcClientCollect : GA_NpcClientFunc { private static List<uint> m_ArrivedList = new List<uint>(); public static event UnityAction<uint, int> OnArrive; public static event UnityAction<uint, int> OnLeave; private bool m_IsMainWinOpen = false; protected override void OnInit(GameNetPackBasic package) { base.OnInit(package); WindowCenter.Instance.windowAfterOpenEvent += CheckOpenCollectIcon; WindowCenter.Instance.windowAfterCloseEvent += AfterCloseMainWin; NPCInteractProcessor.s_NpcInteractEvent += HandleCallback; } private void HandleCallback(E_NpcType type, int npcID, uint sid) { if (sid == ServerInstID) { OnClick(); } } protected override void OnUnit() { if (m_ArrivedList.Contains(ServerInstID)) { if (OnLeave != null) { OnLeave(ServerInstID, NpcConfig.NPCID); } m_ArrivedList.Remove(ServerInstID); } WindowCenter.Instance.windowAfterOpenEvent -= CheckOpenCollectIcon; WindowCenter.Instance.windowAfterCloseEvent -= AfterCloseMainWin; } private void CheckOpenCollectIcon(Window obj) { if (obj is MainInterfaceWin) { m_IsMainWinOpen = true; if (NpcConfig.NPCID != GeneralDefine.GatherSoulDZ) { GA_Hero _hero = PlayerDatas.Instance.hero; if (_hero != null) { float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos); if (_distSqrt < Mathf.Pow(NpcConfig.ModelRadius + 0.4f + GeneralDefine.CloseNpcDist, 2)) { Arrive(); } } } } } private void AfterCloseMainWin(Window obj) { if (obj is MainInterfaceWin) { m_IsMainWinOpen = false; Leave(); } } public override void OnClick() { if (GA_Hero.s_MapSwitching) { return; } GA_Hero _hero = PlayerDatas.Instance.hero; if (_hero == null) { return; } _hero.LockTarget = this; _hero.SelectTarget = this; float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos); // 这里判断是否要走向此对象 if (_chkDistSqrt > 2f) { _hero.MoveToPosition(Pos, 1f); } if (_chkDistSqrt < 4) { StartCollect(); } } private bool m_StartCollect; private float m_CollectTime; public void StartCollect() { if (m_StartCollect) { return; } m_CollectTime = 0; NormalCollectWin.s_CollectInfo = new PrepareHandler.ClientH0812() { PlayerID = PlayerDatas.Instance.PlayerId, PrepareState = (byte)PrepareHandler.E_PrepareType.pstMissionCollecting, MaxTime = 2000, PrepareID = NpcConfig.NPCID, }; PrepareHandler.Instance.isPreparing = true; WindowCenter.Instance.Open<NormalCollectWin>(); m_StartCollect = true; } public void StopCollect() { PrepareHandler.Instance.isPreparing = false; WindowCenter.Instance.Close<NormalCollectWin>(); m_StartCollect = false; } protected override void OnUpdate() { if (m_StartCollect) { GA_Hero m_Hero = PlayerDatas.Instance.hero; m_CollectTime += Time.deltaTime; if (m_CollectTime > 2f) { StopCollect(); if (m_Hero != null) { if (m_Hero.LockTarget == this) { m_Hero.LockTarget = null; } if (m_Hero.SelectTarget == this) { m_Hero.SelectTarget = null; } } if (belongEventID != -1) { ClientSceneManager.Instance.NpcDead(belongEventID, this, NpcConfig.NPCID); } GAMgr.Instance.Release(this); } if (!m_Hero.IsIdle() && !m_Hero.IsCollect()) { StopCollect(); } } } public override void OnSelect() { if (NpcConfig.NPCID != 10204200) { SelectionManager.Request(SelectionManager.E_Type.Green, this, NpcConfig.ModelRadius * 2); } GA_Hero _hero = PlayerDatas.Instance.hero; Vector3 _forward = MathUtility.ForwardXZ(Pos, _hero.Pos); _hero.Forward = _forward; if (NpcConfig.AutomaticFace == 1) { _forward = MathUtility.ForwardXZ(_hero.Pos, Pos); Forward = _forward; } } public override void OnUnSelect() { base.OnUnSelect(); if (m_ArrivedList.Contains(ServerInstID)) { if (OnLeave != null) { OnLeave(ServerInstID, NpcConfig.NPCID); } m_ArrivedList.Remove(ServerInstID); } } protected override void OnFixedUpdate() { base.OnFixedUpdate(); if (!m_IsMainWinOpen) { m_IsMainWinOpen = WindowCenter.Instance.IsOpen<MainInterfaceWin>(); return; } GA_Hero _hero = PlayerDatas.Instance.hero; if (_hero != null) { float _distSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, Pos); if (_distSqrt < Mathf.Pow(NpcConfig.ModelRadius + 0.4f + GeneralDefine.CloseNpcDist, 2)) { Arrive(); } else { if (m_ArrivedList.Contains(ServerInstID)) { if (OnLeave != null) { OnLeave(ServerInstID, NpcConfig.NPCID); } m_ArrivedList.Remove(ServerInstID); } } } } public void Arrive() { if (!m_ArrivedList.Contains(ServerInstID)) { if (OnArrive != null) { OnArrive(ServerInstID, NpcConfig.NPCID); } m_ArrivedList.Add(ServerInstID); Debug.Log("靠近了采集物: " + NpcConfig.NPCID); } } public void Leave() { if (m_ArrivedList.Contains(ServerInstID)) { if (OnLeave != null) { OnLeave(ServerInstID, NpcConfig.NPCID); } m_ArrivedList.Remove(ServerInstID); Debug.Log("离开了采集物: " + NpcConfig.NPCID); } } } Fight/GameActor/GA_NpcClientCollect.cs.meta
New file @@ -0,0 +1,12 @@ fileFormatVersion: 2 guid: 5d176ae09b0a918488a325b4304a2d2d timeCreated: 1553583520 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Fight/GameActor/GA_NpcClientFightNorm.cs
@@ -3,7 +3,6 @@ public class GA_NpcClientFightNorm : GActorNpcFight { public int belongEventID; private HeadUpName m_HeadUpName; private LifeBar m_LifeBar; Fight/GameActor/GA_NpcClientFunc.cs
@@ -22,11 +22,29 @@ Rotation = Quaternion.Euler(0, UnityEngine.Random.Range(0, 360), 0); } ActorType = GameObjType.gotNPC; Root.gameObject.layer = LayerUtility.Monster; if (CanBeSelected()) { CapsuleCollider _collider = Root.AddMissingComponent<CapsuleCollider>(); _collider.center = new Vector3(0, NpcConfig.ModleHeight * .5f, 0); _collider.radius = NpcConfig.ModelRadius; _collider.height = NpcConfig.ModleHeight; m_NPCInteractProcessor = Root.AddMissingComponent<NPCInteractProcessor>(); m_NPCInteractProcessor.npcIntergactEvent += OnClick; } RequestShadow(); if (NpcConfig.NPCEffect != 0) { m_AppearEffect = SFXPlayUtility.Instance.PlayBattleEffect(NpcConfig.NPCEffect, this); } // 开始异步加载表现层 InstanceResourcesLoader.AsyncLoadNpc(NpcConfig.NPCID, OnPrefabLoadFinished); } protected override void OnUnit() Fight/GameActor/GActor.cs
@@ -21,6 +21,23 @@ protected Transform m_Root = null; public Transform Root { get { return m_Root; } } /// <summary> /// 如果有,杀死这个npc的角色服务器实例ID /// </summary> private uint m_KillServerInstID; public uint KillerServerInstID { get { return m_KillServerInstID; } set { m_KillServerInstID = value; } } public int belongEventID; private Vector3 m_BornPos; public virtual Vector3 BornPos { get { return m_BornPos; } set { m_BornPos = value; } } private Vector3 m_Pos; public Vector3 Pos { @@ -298,6 +315,10 @@ m_SearchType = E_SearchType.Dynamic; TargetActor = target; // if (this is GA_Hero) // { // Debug.Log("开始寻路至目标: " + target); // } // 这里记录坐标的意义 // 在可能发生坐标动态变化的目标用以与之前记录坐标比较 // 判断是否在寻路过程中需要重新执行寻路 @@ -326,6 +347,10 @@ m_SearchType = E_SearchType.Static; MoveTo(_validPos, keepDist); } // if (this is GA_Hero) // { // Debug.Log("开始寻路至点: " + destPos); // } } public void ClearPathFindTarget() @@ -343,6 +368,11 @@ return; } // if (this is GA_Hero) // { // Debug.Log("停止寻路"); // } TargetActor = null; DestPos = Vector3.zero; m_CornerIndex = 0; Fight/GameActor/GActorFight.cs
@@ -59,15 +59,6 @@ } /// <summary> /// 如果有,杀死这个npc的角色服务器实例ID /// </summary> private uint m_KillServerInstID; public uint KillerServerInstID { get { return m_KillServerInstID; } set { m_KillServerInstID = value; } } /// <summary> /// 如果有,杀死这个npc使用的死亡飞行配置 /// </summary> public int DeadFlyID { get; set; } Fight/GameActor/GActorNpcFight.cs
@@ -20,13 +20,6 @@ /// </summary> protected float m_LastCantAtkedTime; private Vector3 m_BornPos; public virtual Vector3 BornPos { get { return m_BornPos; } set { m_BornPos = value; } } public override int NextAction { get Fight/GameActor/GActorNpcNoFight.cs
@@ -31,6 +31,19 @@ } } public virtual void InitNpcConfig(int npcID) { if (NpcConfig != null && NpcConfig.NPCID == npcID) { return; } if (npcID > 0) { NpcConfig = NPCConfig.Get(npcID); } } protected override void OnInit(GameNetPackBasic package) { m_LoadDefaultRes = false; Fight/MapTransferUtility.cs
@@ -1202,7 +1202,10 @@ { if (_npc != null) { NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID); if (_npc is GA_NpcClientFightNorm) { NPCInteractProcessor.InvokeEvent(E_NpcType.Func, NpcID, _npc.ServerInstID); } } } Clear(); Fight/Stage/MapEditor/Game/ClientSceneManager.cs
@@ -12,7 +12,7 @@ private Dictionary<int, uint> m_TriggerIDToMissionIDDict = new Dictionary<int, uint>(); private Dictionary<int, TriggerHandler> m_TriggerHandlerDict = new Dictionary<int, TriggerHandler>(); private List<int> m_ReadyRemoveTriggerList = new List<int>(); private Dictionary<int, List<GActorNpcFight>> m_EventActorDict = new Dictionary<int, List<GActorNpcFight>>(); private Dictionary<int, List<GActor>> m_EventActorDict = new Dictionary<int, List<GActor>>(); public bool IsClientFightMode { get; private set; } private IEnumerator DelayUnTrigger(int id) @@ -66,11 +66,11 @@ } } public void NpcBorn(int eventID, GActorNpcFight npc) public void NpcBorn(int eventID, GActor npc) { if (!m_EventActorDict.ContainsKey(eventID)) { m_EventActorDict.Add(eventID, new List<GActorNpcFight>()); m_EventActorDict.Add(eventID, new List<GActor>()); } if (!m_EventActorDict[eventID].Contains(npc)) @@ -80,7 +80,7 @@ } } public void NpcDead(int eventID, GActorNpcFight npc) public void NpcDead(int eventID, GActor npc, int npcID) { if (eventID < 0 || npc == null) { @@ -90,7 +90,7 @@ var _eventHandler = GetEventHandler(eventID) as EventRefreshNPCHandler; if (_eventHandler != null) { _eventHandler.NpcDead(npc.NpcConfig.NPCID); _eventHandler.NpcDead(npcID); } if (m_EventActorDict.ContainsKey(eventID)) @@ -506,6 +506,11 @@ return _targetPos; } public void TriggerTest(int triggerID) { SnxxzGame.Instance.StartCoroutine(DelayTrigger(99999999, triggerID)); } private IEnumerator DelayTrigger(uint missionID, int triggerID) { // ID为0, 约定为清空触发 Fight/Stage/MapEditor/Game/EventRefreshNPCHandler.cs
@@ -87,7 +87,16 @@ if (m_RefreshCount >= 0 && m_RefreshCount < m_Evt.monsters.Length) { var _data = m_Evt.monsters[m_RefreshCount]; var _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>(_data.npcID, E_ActorGroup.Enemy); var _npcConfig = NPCConfig.Get((int)_data.npcID); GActor _npc = null; if (_npcConfig.NPCType == (int)E_NpcType.Collect) { _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>(_data.npcID, E_ActorGroup.FuncNpc); } else { _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>(_data.npcID, E_ActorGroup.Enemy); } _npc.BornPos = _npc.Pos = _data.position; _npc.belongEventID = m_Evt.id; ClientSceneManager.Instance.NpcBorn(m_Evt.id, _npc); @@ -100,7 +109,16 @@ { foreach (var _data in m_Evt.monsters) { var _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>(_data.npcID, E_ActorGroup.Enemy); var _npcConfig = NPCConfig.Get((int)_data.npcID); GActor _npc = null; if (_npcConfig.NPCType == (int)E_NpcType.Collect) { _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>(_data.npcID, E_ActorGroup.FuncNpc); } else { _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>(_data.npcID, E_ActorGroup.Enemy); } _npc.BornPos = _npc.Pos = _data.position; _npc.belongEventID = m_Evt.id; ClientSceneManager.Instance.NpcBorn(m_Evt.id, _npc); Fight/Stage/MapEditor/Game/TransferGroup.cs
@@ -64,6 +64,7 @@ m_Step = 11; GA_Hero.s_MapSwitching = true; _hero.StopPathFind(); _hero.Behaviour.StopHandupAI(true); startPoint = i; if (i == 0) { System/Auction/AuctionHelpModel.cs
@@ -32,6 +32,7 @@ public int AuctionTaxrate3 = 0;//仙盟拍品个人税率 public int MaxFocusCount = 10;//最大可关注数量 public int ExtensionTime = 0;//延长时间(秒) private int selectedGenreNow = 0; public int SelectedGenreNow//当前选择的页签 { @@ -58,8 +59,9 @@ } public override void Init() { var funconfig = FuncConfigConfig.Get("AuctionHouse").Numerical5; MaxFocusCount = int.Parse(funconfig); var funconfig = FuncConfigConfig.Get("AuctionHouse"); MaxFocusCount = int.Parse(funconfig.Numerical5); ExtensionTime = int.Parse(funconfig.Numerical4); var AuctionTaxrateConfig = FuncConfigConfig.Get("AuctionTaxrate"); AuctionTaxrate1 = int.Parse(AuctionTaxrateConfig.Numerical1); AuctionTaxrate2 = int.Parse(AuctionTaxrateConfig.Numerical2); System/Auction/AuctionInquiryModel.cs
@@ -101,7 +101,7 @@ PlayerDatas.Instance.fairyData.OnRefreshFairyMine += OnRefreshFairyMine; } public override void UnInit() { @@ -109,7 +109,7 @@ private void OnRefreshFairyMine()//用于被提出仙盟清除仙盟拍品 { if (PlayerDatas.Instance.baseData.FamilyId==0) if (PlayerDatas.Instance.baseData.FamilyId == 0) { FamilyAuctionItemDic.Clear(); if (ClearFamilyAuctionUpdate != null) @@ -132,7 +132,11 @@ playerAuctionItemClass.ItemCount = (int)PlayerAuctionItem.ItemCount; playerAuctionItemClass.TimeStr = PlayerAuctionItem.AddTime; playerAuctionItemClass.Time = DateTime.Parse(PlayerAuctionItem.AddTime); playerAuctionItemClass.TimeEnd= DateTime.Parse(PlayerAuctionItem.BiddingTime); var str = UIHelper.ServerStringTrim(PlayerAuctionItem.BiddingTime); if (!str.Equals(string.Empty)) { playerAuctionItemClass.TimeEnd = DateTime.Parse(str); } playerAuctionItemClass.BidderPrice = PlayerAuctionItem.BidderPrice; playerAuctionItemClass.UserData = PlayerAuctionItem.UserData; var index = FullServiceAuctionList.FindIndex((x) => { return x.ItemGUID == PlayerAuctionItem.ItemGUID; }); @@ -153,7 +157,7 @@ { FullServiceAuctionList.InsertRange(FullServiceAuctionList.Count - 1, fullServiceAuctionList); } } else if (info.QueryDir == 2)//往前查询 { @@ -171,7 +175,7 @@ FullServiceAuctionList.InsertRange(FullServiceAuctionList.Count - 1, fullServiceAuctionList); } LocationQuery = true; WindowCenter.Instance.Open<AuctionHouseWin>(true,0);//定位查询 WindowCenter.Instance.Open<AuctionHouseWin>(true, 0);//定位查询 } if (FullServiceAuctionUpdate != null) @@ -192,7 +196,11 @@ playerAuctionItemClass.ItemCount = (int)PlayerAuctionItem.ItemCount; playerAuctionItemClass.TimeStr = PlayerAuctionItem.AddTime; playerAuctionItemClass.Time = DateTime.Parse(PlayerAuctionItem.AddTime); playerAuctionItemClass.TimeEnd= DateTime.Parse(PlayerAuctionItem.BiddingTime); var str = UIHelper.ServerStringTrim(PlayerAuctionItem.BiddingTime); if (!str.Equals(string.Empty)) { playerAuctionItemClass.TimeEnd = DateTime.Parse(str); } playerAuctionItemClass.BidderPrice = PlayerAuctionItem.BidderPrice; playerAuctionItemClass.UserData = PlayerAuctionItem.UserData; if (PlayerAuctionItemInfoDic.ContainsKey(playerAuctionItemClass.ItemGUID)) @@ -280,7 +288,11 @@ familyAuctionItemClass.ItemCount = (int)FamilyAuctionItem.ItemCount; familyAuctionItemClass.TimeStr = FamilyAuctionItem.AddTime; familyAuctionItemClass.Time = DateTime.Parse(FamilyAuctionItem.AddTime); familyAuctionItemClass.TimeEnd= DateTime.Parse(FamilyAuctionItem.BiddingTime); var str = UIHelper.ServerStringTrim(FamilyAuctionItem.BiddingTime); if (!str.Equals(string.Empty)) { familyAuctionItemClass.TimeEnd = DateTime.Parse(str); } familyAuctionItemClass.BidderPrice = FamilyAuctionItem.BidderPrice; familyAuctionItemClass.UserData = FamilyAuctionItem.UserData; familyAuctionItemClass.FamilyPlayerIDInfo = FamilyAuctionItem.FamilyPlayerIDInfo; @@ -327,7 +339,11 @@ playerAuctionItemClass.ItemCount = (int)AttentionAuctionItem.ItemCount; playerAuctionItemClass.TimeStr = AttentionAuctionItem.AddTime; playerAuctionItemClass.Time = DateTime.Parse(AttentionAuctionItem.AddTime); playerAuctionItemClass.TimeEnd= DateTime.Parse(AttentionAuctionItem.BiddingTime); var str = UIHelper.ServerStringTrim(AttentionAuctionItem.BiddingTime); if (!str.Equals(string.Empty)) { playerAuctionItemClass.TimeEnd = DateTime.Parse(str); } playerAuctionItemClass.BidderPrice = AttentionAuctionItem.BidderPrice; playerAuctionItemClass.UserData = AttentionAuctionItem.UserData; if (AttentionAuctionItemDic.ContainsKey(playerAuctionItemClass.ItemGUID)) @@ -378,7 +394,11 @@ { FamilyAuctionItem.TimeStr = RefreshAuctionItem.AddTime; FamilyAuctionItem.Time = DateTime.Parse(RefreshAuctionItem.AddTime); FamilyAuctionItem.TimeEnd= DateTime.Parse(RefreshAuctionItem.BiddingTime); var str = UIHelper.ServerStringTrim(RefreshAuctionItem.BiddingTime); if (!str.Equals(string.Empty)) { FamilyAuctionItem.TimeEnd = DateTime.Parse(str); } FamilyAuctionItem.BidderID = (int)RefreshAuctionItem.BidderID; FamilyAuctionItem.BidderPrice = (int)RefreshAuctionItem.BidderPrice; FamilyAuctionItemDic[RefreshAuctionItem.ItemGUID] = FamilyAuctionItem; @@ -464,7 +484,11 @@ BiddingItemClass.FamilyID = (int)BiddingItem.FamilyID; BiddingItemClass.TimeStr = BiddingItem.AddTime; BiddingItemClass.Time = DateTime.Parse(BiddingItem.AddTime); BiddingItemClass.TimeEnd= DateTime.Parse(BiddingItem.BiddingTime); var str = UIHelper.ServerStringTrim(BiddingItem.BiddingTime); if (!str.Equals(string.Empty)) { BiddingItemClass.TimeEnd = DateTime.Parse(str); } BiddingItemClass.BidderPrice = BiddingItem.BidderPrice;//竞拍玩家出价 BiddingItemClass.BidderID = (int)BiddingItem.BidderID;//竞拍玩家ID,也就是当前最高竞价玩家ID BiddingItemClass.UserData = BiddingItem.UserData; @@ -483,9 +507,9 @@ } } private void SetRedPoint() private void SetRedPoint() { int GetDayOfYear = DateTime.Now.DayOfYear; int GetDayOfYear = DateTime.Now.DayOfYear; string strKey = "AuctionRedPoint" + PlayerDatas.Instance.baseData.PlayerID; int day = LocalSave.GetInt(strKey); if (day != GetDayOfYear) System/Auction/FullServiceAuctioncell.cs
@@ -201,8 +201,10 @@ if (AuctionItem != null && FullServiceAuction != null) { var timeNow = TimeUtility.ServerNow; TimeSpan timeSpan = timeNow - FullServiceAuction.Time; TimeSpan timeSpan = timeNow - FullServiceAuction.Time; int minute = (int)timeSpan.TotalMinutes; DateTime extensionTime = FullServiceAuction.TimeEnd.AddSeconds(auctionHelpModel.ExtensionTime); if (minute < AuctionItem.NoticeSaleMinutes)//预热中 { if (m_PriceButton.interactable) @@ -218,7 +220,7 @@ int seconds = AuctionItem.NoticeSaleMinutes * 60 - (int)timeSpan.TotalSeconds; m_TimeText.text = Language.Get("PMH_03", TimeUtility.SecondsToHMS(seconds)); } else if (minute >= AuctionItem.NoticeSaleMinutes && minute <= AuctionItem.WorldSaleMinutes)//拍卖中 else if (minute <= AuctionItem.WorldSaleMinutes)//拍卖中 { var maxMoney = AuctionItem.BuyoutPrice * FullServiceAuction.ItemCount; var needMoney = 0; @@ -248,6 +250,13 @@ int seconds = AuctionItem.WorldSaleMinutes * 60 - ((int)timeSpan.TotalSeconds - AuctionItem.NoticeSaleMinutes * 60); m_TimeText.text = Language.Get("PMH_04", TimeUtility.SecondsToHMS(seconds)); } else if(timeNow< extensionTime) { m_TimeText.text = Language.Get("PMH_04",0); TimeSpan timeSpan2 = extensionTime - timeNow; int timeSeconds = (int)timeSpan2.TotalSeconds; DebugEx.LogError(Language.Get("PMH_04", TimeUtility.SecondsToHMS(timeSeconds))); } } } } System/MainInterfacePanel/MainButtonMisc.cs
@@ -1,14 +1,14 @@ //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Tuesday, February 19, 2019 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; //-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Tuesday, February 19, 2019 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; namespace Snxxz.UI { { public class MainButtonMisc : MonoBehaviour { [SerializeField] Button m_RedBag;//红包入口按钮 @@ -52,7 +52,7 @@ CheckSendRedpackBtn(); ShowFairyGrabBoss(); IsCrossServerOneVsOne(); RedPacketModel.OnRedBagGetEvent += OnRedBagGet; OSEnvelopeModel.OSRedEnvelopeUpdateEvent += OnRedBagGet; OSEnvelopeModel.OSRedEnvelopeInfoEnvent += OnRedBagGet; @@ -60,6 +60,8 @@ PlayerDatas.Instance.playerDataRefreshEvent += Updatefighting; GA_NpcCollect.OnArrive += OnArriveCollectNPC; GA_NpcCollect.OnLeave += OnLeaveCollectNpc; GA_NpcClientCollect.OnArrive += OnArriveCollectNPC; GA_NpcClientCollect.OnLeave += OnLeaveCollectNpc; wishModel.UpdateWishAwardEvent += UpdateWishAwardImag; purchaseModel.UpdateNewMysticalEvent += UpdateMysticalPurchaseImag; assistModel.UpdateRedpointEvent += UpdateDungeonAssistImag; @@ -67,12 +69,12 @@ fairyGrabBossModel.gotoBossStateUpdate += ShowFairyGrabBoss; ChatTip.OnChatUpEvent += RefreshAdaptiveChat; fairyModel.UpdateFairyRequestEvent += UpdateFairyRequest; } } public void OnActived() { RefreshAdaptiveChat(); RefreshAdaptiveChat(); } } public void Unit() { m_CollectBehaviour.Dispose(); @@ -215,11 +217,11 @@ { m_CollectBehaviour.Dispose(); m_CollectBehaviour.gameObject.SetActive(false); } } private void ClickWishAward() { WindowCenter.Instance.Open<WishingGetItemWin>(); } } private void UpdateWishAwardImag() { m_WishingAwardImg.gameObject.SetActive(wishModel.wishingAwardDict.Count > 0 ? true : false); @@ -235,7 +237,7 @@ private void ClickDungeonAssist() { WindowCenter.Instance.Open<DungeonAssistWin>(); } } private void UpdateDungeonAssistImag() { m_DungeonAssistImg.gameObject.SetActive(assistModel.IsNewAssistInfo); @@ -297,7 +299,7 @@ { if (fairyGrabBossModel.flyToGrabBossRemind) { var money = (int)UIHelper.GetMoneyCnt(1) ; var money = (int)UIHelper.GetMoneyCnt(1); if (money >= 1) { FlyShoesUseCallback(); @@ -369,18 +371,18 @@ private void OnClickFriendQuest() { WindowCenter.Instance.Open<FriendQuestWin>(); } } private void OnFairyRequestClick() { WindowCenter.Instance.Open<FairyInviteWin>(); } } private void UpdateFairyRequest() { m_FairyRequestBtn.gameObject.SetActive(fairyModel.FairyRequestRedPoint.count > 0); } } } } } } System/MainInterfacePanel/MainCollectBehaviour.cs
@@ -1,7 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI @@ -82,5 +82,5 @@ } } } } } System/Realm/NormalCollectWin.cs
@@ -73,7 +73,6 @@ { var progress = 1 - (float)(endTime - TimeUtility.ServerNow).TotalMilliseconds / s_CollectInfo.MaxTime; m_SmoothSlider.value = progress; progress = (float)Math.Round(progress * 100, 0); if (currentProgress != progress) { Utility/EnumHelper.cs
@@ -6,8 +6,8 @@ Guard, NpcFightNorm, NpcFightBoss, NpcCollect, NpcSummonFunc, NpcCollect, NpcSummonFight, NpcFunc, Pet,