Main/Component/UI/Common/AutoSelectCyclicScroll.cs
@@ -7,8 +7,6 @@ using UnityEngine.UI; using UnityEngine.EventSystems; namespace vnxbqy.UI { public class AutoSelectCyclicScroll : CyclicScroll { @@ -51,8 +49,5 @@ } } Main/Component/UI/Common/AutoSelectScrollItem.cs
@@ -4,13 +4,10 @@ using UnityEngine.UI; using System; namespace vnxbqy.UI { public class AutoSelectScrollItem : ScrollItem { public AutoSelectCyclicScroll autoSelectScroll { get; set; } public RectTransform centerSign { get; set; } } } Main/Component/UI/Common/ButtonClickInterval.cs
@@ -3,8 +3,6 @@ using UnityEngine.UI; using System.Collections; namespace vnxbqy.UI { public class ButtonClickInterval : MonoBehaviour { @@ -26,6 +24,5 @@ { yield return new WaitForSeconds(interval); targetBtn.enabled = true; } } } Main/Component/UI/Common/CanvasRaycastFilter.cs
@@ -6,8 +6,6 @@ using System.Collections; using UnityEngine.UI; namespace vnxbqy.UI { public class CanvasRaycastFilter : MonoBehaviour, ICanvasRaycastFilter { @@ -22,7 +20,6 @@ } } Main/Component/UI/Common/CoolDownBehaviour.cs
@@ -6,8 +6,6 @@ using System.Collections; using UnityEngine.UI; namespace vnxbqy.UI { public class CoolDownBehaviour : MonoBehaviour { @@ -83,7 +81,6 @@ } } Main/Component/UI/Common/DragContainer.cs
@@ -5,7 +5,6 @@ using UnityEngine; using System.Collections; namespace vnxbqy.UI { public class DragContainer:MonoBehaviour { @@ -13,7 +12,6 @@ } } Main/Component/UI/Common/DragItem.cs
@@ -7,8 +7,6 @@ using UnityEngine.EventSystems; using System; namespace vnxbqy.UI { public class DragItem:MonoBehaviour,ICanvasRaycastFilter,IBeginDragHandler,IDragHandler,IEndDragHandler { [SerializeField] @@ -54,8 +52,6 @@ public bool IsRaycastLocationValid(Vector2 sp,Camera eventCamera) { return raycastTarget; } } } Main/Component/UI/Common/DynamicCyclicScroll.cs
@@ -7,8 +7,6 @@ using UnityEngine.UI; using System.Collections.Generic; namespace vnxbqy.UI { public class DynamicCyclicScroll : CyclicScroll { @@ -38,7 +36,6 @@ } } Main/Component/UI/Common/FrameEffect.cs
@@ -7,8 +7,6 @@ using UnityEngine.UI; using System; namespace vnxbqy.UI { public class FrameEffect : MonoBehaviour { @@ -92,7 +90,6 @@ } } Main/Component/UI/Common/FuncEnable.cs
@@ -3,8 +3,6 @@ using System.Collections.Generic; using UnityEngine; namespace vnxbqy.UI { public class FuncEnable : MonoBehaviour { [SerializeField] int funcOpenKey; @@ -37,7 +35,6 @@ } gameObject.SetActive(true); } } } Main/Component/UI/Common/FunctionButton.cs
@@ -10,8 +10,6 @@ using System; namespace vnxbqy.UI { public class FunctionButton : Button @@ -256,7 +254,6 @@ } } Main/Component/UI/Common/FunctionButtonGroup.cs
@@ -8,8 +8,6 @@ using UnityEngine.UI; using UnityEngine.Events; namespace vnxbqy.UI { public class FunctionButtonGroup : MonoBehaviour { @@ -263,7 +261,6 @@ } } } Main/Component/UI/Common/GameObjectDefaultActive.cs
@@ -5,7 +5,6 @@ using UnityEngine; using System.Collections; namespace vnxbqy.UI { public class GameObjectDefaultActive:MonoBehaviour { [SerializeField] @@ -21,7 +20,6 @@ } } Main/Component/UI/Common/InputSpecialWordLimit.cs
@@ -4,8 +4,6 @@ using System.Globalization; using UnityEngine; using UnityEngine.UI; namespace vnxbqy.UI { [RequireComponent(typeof(InputField))] public class InputSpecialWordLimit : MonoBehaviour { @@ -37,7 +35,6 @@ } } return addedChar; } } } Main/Component/UI/Common/LanguageReplace.cs
@@ -3,8 +3,6 @@ using UnityEngine; using UnityEngine.UI; using System; namespace vnxbqy.UI { //设置文本,来源读取J.进入游戏前的提示.xlsx public class LanguageReplace : MonoBehaviour { @@ -19,5 +17,4 @@ textObj.text = Language.GetFromLocal(uiLanguage); } } } Main/Component/UI/Common/LongPressButton.cs
@@ -6,8 +6,6 @@ using UnityEngine.Serialization; using UnityEngine.UI; namespace vnxbqy.UI { public class LongPressButton : ButtonEx { public class ButtonPressEvent : UnityEvent { } @@ -98,5 +96,3 @@ m_IsButtonDown = false; } } } Main/Component/UI/Common/MultipleSmoothSlider.cs
@@ -3,8 +3,6 @@ using UnityEngine.UI; using System; namespace vnxbqy.UI { [DisallowMultipleComponent] public class MultipleSmoothSlider : MonoBehaviour @@ -91,5 +89,3 @@ } } } Main/Component/UI/Common/NestingScrollRect.cs
@@ -3,8 +3,6 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; namespace vnxbqy.UI { [RequireComponent(typeof(ScrollRect))] public class NestingScrollRect : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler { @@ -54,5 +52,3 @@ scrollRect.OnEndDrag(eventData); } } } Main/Component/UI/Common/OnOffToggle.cs
@@ -7,8 +7,6 @@ using UnityEngine.UI; using UnityEngine.Events; namespace vnxbqy.UI { public class OnOffToggle : MonoBehaviour { @@ -56,8 +54,3 @@ m_OffShow.SetActive(!_isOn); } } } Main/Component/UI/Common/PopupMessage.cs
@@ -6,7 +6,6 @@ using System.Collections; using UnityEngine.UI; namespace vnxbqy.UI { public class PopupMessage:MonoBehaviour { @@ -50,9 +49,4 @@ } } Main/Component/UI/Common/PopupMessageContainer.cs
@@ -6,8 +6,6 @@ using System.Collections; using System.Collections.Generic; namespace vnxbqy.UI { [RequireComponent(typeof(RectTransform))] public class PopupMessageContainer:MonoBehaviour { @@ -75,8 +73,5 @@ } } Main/Component/UI/Common/SmoothMask.cs
@@ -96,6 +96,9 @@ } private void UpdateChildMaterialSmoothMask() { if (null == canvasScaler) return; var scaleX = canvasScaler.transform.localScale.x; var scaleY = canvasScaler.transform.localScale.y; Main/Component/UI/Common/SmoothSlider.cs
@@ -3,8 +3,6 @@ using UnityEngine; using UnityEngine.UI; namespace vnxbqy.UI { [DisallowMultipleComponent] @@ -65,8 +63,6 @@ { slider.value = Mathf.SmoothDamp(slider.value, value, ref refSpeed, delay); } } } } Main/Component/UI/Decorate/Tweens/PositionTween.cs
@@ -1,8 +1,6 @@ using UnityEngine; using System.Collections; namespace vnxbqy.UI { public class PositionTween : Tween { @@ -44,5 +42,4 @@ this.rectTransform.anchoredPosition = CalculateVector3(); } } } Main/Component/UI/Decorate/Tweens/ScaleTween.cs
@@ -1,8 +1,6 @@ using UnityEngine; using System.Collections; namespace vnxbqy.UI { public class ScaleTween : Tween { public override void SetStartState() @@ -33,8 +31,6 @@ { base.UpdateVector3(); this.transform.localScale = CalculateVector3(); } } } Main/Component/UI/Decorate/Tweens/Tween.cs
@@ -2,8 +2,6 @@ using System.Collections; using System; namespace vnxbqy.UI { [RequireComponent(typeof(RectTransform))] public class Tween : MonoBehaviour { @@ -230,7 +228,6 @@ Loop, PingPong, PingPongOnce, } } } Main/Component/UI/Effect/UIEffect.cs
@@ -10,7 +10,6 @@ using UnityEditor; #endif using CJ.Wait; public class UIEffect : MonoBehaviour Main/Component/UI/Manager/UIEventTrigger.cs
@@ -3,7 +3,6 @@ using UnityEngine; using UnityEngine.EventSystems; using System; using CJ.Wait; public class UIEventTrigger : EventTrigger { public delegate void ObjectDelegate(GameObject go,PointerEventData eventData); Main/System/Chat.metacopy from Main/UI/Launch.meta copy to Main/System/Chat.meta
File was copied from Main/UI/Launch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 guid: 91e90d274ca17e84aab980cb88d23de7 guid: 75379fcf96e9da74a849e8fc132ff30f folderAsset: yes DefaultImporter: externalObjects: {} Main/System/Chat/ChatData.cs
New file @@ -0,0 +1,226 @@ using System.Text; using System.Collections; using vnxbqy.UI; using System; public class ChatData { // public ChatData(string content) // { // _content = content; // if (ChatCenter.s_VoiceRegex.IsMatch(_content)) // { // _content = ChatCenter.s_VoiceRegex.Replace(_content, string.Empty); // } // richText = new StringBuilder(); // richText.Length = 0; // createTime = DateTime.Now; // } private string _content = string.Empty; public string content { get { if (richText.Length > 0) { return richText.ToString(); } return _content; } protected set { _content = value; } } // public ChatInfoType type { get; protected set; } // public DateTime createTime { get; set; } // private ChatInfoType m_DetailType = ChatInfoType.World; // public ChatInfoType detailType // { // get // { // return m_DetailType; // } // set // { // m_DetailType = value; // } // } public StringBuilder richText; public ArrayList infoList = new ArrayList(); } public class ChatUeseData : ChatData { public ChatUeseData() { } public ChatUeseData(string _content, int player, string name, string extra)// : base(_content) { this.player = player; this.name = name; extra = UIHelper.ServerStringTrim(extra); this.extra = extra; this.job = 1; IsSound = false; var extraLength = extra.Length; if (extraLength > 1) { vipLv = int.Parse(extra.Substring(0, 2)); } if (extraLength > 2) { isGm = byte.Parse(extra.Substring(2, 1)) == 1; } if (extraLength > 3) { job = byte.Parse(extra.Substring(3, 1)); } if (extraLength > 4) { bubbleId = int.Parse(extra.Substring(4, extraLength > 5 ? 2 : 1)); } if (extraLength > 12) { serverGroupId = int.Parse(extra.Substring(6, 7)); } if (extraLength > 16) { level = int.Parse(extra.Substring(13, 4)); } // if (ChatCenter.s_VoiceRegex.IsMatch(_content)) // { // var _match = ChatCenter.s_VoiceRegex.Match(_content); // soundTick = long.Parse(_match.Groups[1].Value); // soundLength = byte.Parse(_match.Groups[2].Value)/10.0f; // IsSound = true; // } string[] parts = extra.Split('|'); face = (parts.Length > 4 && int.TryParse(parts[4], out var result1)) ? result1 : 0; facePic = (parts.Length > 5 && int.TryParse(parts[5], out var result2)) ? result2 : 0; } public int player { get; protected set; } public string name { get; protected set; } public string extra { get; protected set; } public int vipLv { get; protected set; } public bool isGm { get; protected set; } public int job { get; protected set; } public int bubbleId { get; protected set; } public long soundTick { get; private set; } public bool IsSound { get; private set; } public float soundLength { get; private set; } public int serverGroupId { get; private set; } public int level { get; private set; } public int face { get; private set; } public int facePic { get; private set; } } public class ChatSystemData : ChatData { // public ChatSystemData(string content) : base(content) // { // type = ChatInfoType.System; // } } // 喇叭暂时不要了 // public class ChatTrumpetData : ChatUeseData // { // public ChatTrumpetData(string content, int player, string name, string extra, byte speakType, string accId) : base(content, player, name, extra) // { // this.speakType = speakType; // this.accId = accId; // // type = ChatInfoType.Trumpet; // } // public byte speakType { get; protected set; } // public string accId { get; protected set; } // } public class ChatWorldData : ChatUeseData { // public ChatWorldData(string content, int player, string name, string extra) : base(content, player, name, extra) // { // type = ChatInfoType.World; // } } public class ChatAreaData : ChatUeseData { // public ChatAreaData(string content, int player, string name, string extra) : base(content, player, name, extra) // { // type = ChatInfoType.Area; // } } public class ChatCrossServerData : ChatUeseData { // public ChatCrossServerData(string content, int player, string name, string extra) : base(content, player, name, extra) // { // type = ChatInfoType.CrossServer; // } } public class ChatFactionData : ChatUeseData { // public ChatFactionData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.default1) : base(content, player, name, extra) // { // type = ChatInfoType.default1; // this.detailType = detailType; // } } public class ChatTeamData : ChatUeseData { // public ChatTeamData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.Team) : base(content, player, name, extra) // { // type = ChatInfoType.Team; // this.detailType = detailType; // } } public class ChatFamilyData : ChatUeseData { // public ChatFamilyData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.Fairy) : base(content, player, name, extra) // { // type = ChatInfoType.Fairy; // this.detailType = detailType; // } } public class ChatInviteData : ChatUeseData { // public ChatInviteData(string content, int player, string name, string extra) : base(content, player, name, extra) // { // type = ChatInfoType.Invite; // } } public class ChatFriendData : ChatUeseData { // public ChatFriendData(string content, int player, string name, string extra, string toName, byte talkType, uint toPlayer) : base(content, player, name, extra) // { // type = ChatInfoType.Friend; // this.toName = toName; // this.talkType = talkType; // this.toPlayer = (int)toPlayer; // } public string toName { get; protected set; } public byte talkType { get; protected set; } public int toPlayer { get; protected set; } } Main/System/Chat/ChatData.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: e982ff8b244efbc40b4832c2ed2df164 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Message/MessageWin.cs
@@ -1,302 +1,313 @@ // using System.Collections; // using System.Collections.Generic; // using UnityEngine; // using UnityEngine.UI; // using CJ.Wait; // using System; using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using DG.Tweening; using Cysharp.Threading.Tasks; // using System.Text.RegularExpressions; // using DG.Tweening; // namespace vnxbqy.UI // { using System; // public class MessageWin : Window // { // [SerializeField] RectTransform m_ContainerNormalHint; // [SerializeField] RichText m_NormalHint; // [SerializeField] RectTransform m_ContainerChatHint; // [SerializeField] RichText m_NormalChatHint; //显示在聊天界面的位置 using System.Text.RegularExpressions; using DG.Tweening; // [SerializeField] RectTransform m_ContainerServerTip; // [SerializeField] ScaleTween m_ServerTipScaleTween; // [SerializeField] PositionTween m_ServerTipPositionTween; // [SerializeField] RichText m_ServerTip; // [SerializeField, Header("全服广播停留时间")] float m_ServerTipKeepTime = 1.5f; public class MessageWin : UIBase { [SerializeField] RectTransform m_ContainerNormalHint; [SerializeField] RichText m_NormalHint; [SerializeField] RectTransform m_ContainerChatHint; [SerializeField] RichText m_NormalChatHint; //显示在聊天界面的位置 // [SerializeField] RectTransform m_ContainerGM; // [SerializeField] Text m_GmRichText; // [SerializeField] ScrollerController m_ScrollControl; // [SerializeField] Toggle m_AutoPopToggle; // [SerializeField] Toggle m_AutoRefreshToggle; // [SerializeField] Button m_GMClose; [SerializeField] RectTransform m_ContainerServerTip; [SerializeField] ScaleTween m_ServerTipScaleTween; [SerializeField] PositionTween m_ServerTipPositionTween; [SerializeField] RichText m_ServerTip; [SerializeField, Header("全服广播停留时间")] float m_ServerTipKeepTime = 1.5f; // bool m_ServerTipPrepared = true; [SerializeField] RectTransform m_ContainerGM; [SerializeField] Text m_GmRichText; [SerializeField] ScrollerController m_ScrollControl; [SerializeField] Toggle m_AutoPopToggle; [SerializeField] Toggle m_AutoRefreshToggle; [SerializeField] Button m_GMClose; // protected override void BindController() // { // } bool m_ServerTipPrepared = true; // protected override void AddListeners() // { // m_ContainerNormalHint.OnWaitCompelete(OnHintDisplayComplete); // m_ContainerChatHint.OnWaitCompelete(OnHintDisplayComplete); // m_ScrollControl.OnRefreshCell += OnRefreshGmCell; // m_ScrollControl.OnGetDynamicSize += OnGetDynamicSize; // m_ScrollControl.lockType = EnhanceLockType.LockVerticalBottom; // m_GMClose.onClick.AddListener(OnGMClose); // } // 生命周期 protected override void Awake() { base.Awake(); } // protected override void OnPreOpen() // { // m_ServerTipPrepared = true; protected override void Start() { base.Start(); // 初始化数据 } // #if UNITY_EDITOR // m_ContainerGM.SetActive(VersionConfig.Get().debugVersion); // #else // m_ContainerGM.SetActive(false); // #endif // ServerTipDetails.normalHintRefresh += CheckNormalHint; // ServerTipDetails.serverHintRefresh += CheckServerHint; // ServerTipDetails.gmMessageRefresh += DisplayGM; // ServerTipDetails.gmOpenEvent += GmOpenEvent; // ServerTipDetails.chatHintRefresh += CheckChatHint; // CheckNormalHint(); // CheckChatHint(); // CheckServerHint(); // DisplayGM(string.Empty); protected override void InitComponent() { base.InitComponent(); // 初始化组件 m_ContainerNormalHint.OnWaitCompelete(OnHintDisplayComplete); m_ContainerChatHint.OnWaitCompelete(OnHintDisplayComplete); m_ScrollControl.OnRefreshCell += OnRefreshGmCell; m_ScrollControl.OnGetDynamicSize += OnGetDynamicSize; m_ScrollControl.lockType = EnhanceLockType.LockVerticalBottom; m_GMClose.onClick.AddListener(OnGMClose); } // if (ServerTipDetails.requireOpenGM) // { // if (hasOnFrom) // { // OnGMOpen(); // } // ServerTipDetails.requireOpenGM = false; // } // } protected override void OnPreOpen() { // 子类可以重写此方法进行额外的预打开操作 base.OnPreOpen(); m_ServerTipPrepared = true; // protected override void OnAfterOpen() // { // } #if UNITY_EDITOR m_ContainerGM.SetActive(VersionConfig.Get().debugVersion); #else m_ContainerGM.SetActive(false); #endif ServerTipDetails.normalHintRefresh += CheckNormalHint; ServerTipDetails.serverHintRefresh += CheckServerHint; ServerTipDetails.gmMessageRefresh += DisplayGM; ServerTipDetails.gmOpenEvent += GmOpenEvent; ServerTipDetails.chatHintRefresh += CheckChatHint; CheckNormalHint(); CheckChatHint(); CheckServerHint(); DisplayGM(string.Empty); // protected override void OnPreClose() // { // ServerTipDetails.normalHintRefresh -= CheckNormalHint; // ServerTipDetails.serverHintRefresh -= CheckServerHint; // ServerTipDetails.gmMessageRefresh -= DisplayGM; // ServerTipDetails.gmOpenEvent -= GmOpenEvent; // ServerTipDetails.chatHintRefresh -= CheckChatHint; // } if (ServerTipDetails.requireOpenGM) { if (hasOnFrom) { OnGMOpen(); } ServerTipDetails.requireOpenGM = false; } } // protected override void OnAfterClose() // { // } // UI事件 protected override void OnOpen() { base.OnOpen(); // 窗口打开时的逻辑 } // private void GmOpenEvent() // { // if (ServerTipDetails.requireOpenGM) // { // OnGMOpen(); // ServerTipDetails.requireOpenGM = false; // } // } protected override void OnClose() { base.OnClose(); ServerTipDetails.normalHintRefresh -= CheckNormalHint; ServerTipDetails.serverHintRefresh -= CheckServerHint; ServerTipDetails.gmMessageRefresh -= DisplayGM; ServerTipDetails.gmOpenEvent -= GmOpenEvent; ServerTipDetails.chatHintRefresh -= CheckChatHint; // 窗口关闭时的逻辑 // void CheckNormalHint() // { // var hint = ServerTipDetails.RequireNormalHint(); // if (hint != null) // { // DisplayNormalHint(hint); // } // } } // void DisplayNormalHint(SystemHintData hint) // { // transform.SetAsLastSibling(); // m_NormalHint.SetExtenalData(hint.extentionData); // m_NormalHint.text = hint.message; // if (!m_ContainerNormalHint.gameObject.activeInHierarchy) // { // m_ContainerNormalHint.SetActive(true); // } // m_ContainerNormalHint.DoWaitRestart(); // } private void GmOpenEvent() { if (ServerTipDetails.requireOpenGM) { OnGMOpen(); ServerTipDetails.requireOpenGM = false; } } // private void OnHintDisplayComplete(Component com) // { // com.DoWaitStop(); // com.SetActive(false); // } private void OnDisable() { m_ContainerNormalHint.SetActive(false); m_ContainerChatHint.SetActive(false); DisableServerTip(); StopAllCoroutines(); } // void CheckServerHint() // { // if (!m_ServerTipPrepared) void CheckNormalHint() { var hint = ServerTipDetails.RequireNormalHint(); if (hint != null) { DisplayNormalHint(hint); } } void DisplayNormalHint(SystemHintData hint) { transform.SetAsLastSibling(); m_NormalHint.SetExtenalData(hint.extentionData); m_NormalHint.text = hint.message; if (!m_ContainerNormalHint.gameObject.activeInHierarchy) { m_ContainerNormalHint.SetActive(true); } m_ContainerNormalHint.DoWaitRestart(); } private void OnHintDisplayComplete(Component com) { com.DoWaitStop(); com.SetActive(false); } void CheckServerHint() { if (!m_ServerTipPrepared) { return; } var hint = ServerTipDetails.RequireServerTip(); if (hint != null && gameObject.activeInHierarchy) { DisplayServerHint(hint); } else { DisableServerTip(); } } public void DisplayServerHint(SystemHintData hint) { transform.SetAsLastSibling(); m_ServerTipPrepared = false; if (!m_ServerTipScaleTween.gameObject.activeSelf) { m_ServerTipScaleTween.SetActive(true); } m_ServerTipScaleTween.SetStartState(); m_ServerTipPositionTween.SetStartState(); m_ContainerServerTip.SetActive(true); m_ServerTip.SetExtenalData(hint.extentionData); m_ServerTip.text = hint.message; m_ServerTipScaleTween.Play(); TimeMgr.Instance.Register(m_ServerTip, ServerTipStartHide, m_ServerTipKeepTime + m_ServerTipScaleTween.duration); } private void ServerTipStartHide(Component comp) { m_ServerTipPositionTween.Play(); TimeMgr.Instance.Register(m_ServerTipPositionTween, ServerTipTweenComplete, m_ServerTipPositionTween.duration); } private void ServerTipTweenComplete(Component comp) { m_ServerTipPrepared = true; DisableServerTip(); CheckServerHint(); } private void DisableServerTip() { TimeMgr.Instance.UnRegister(m_ServerTip); TimeMgr.Instance.UnRegister(m_ServerTipPositionTween); m_ContainerServerTip.SetActive(false); m_ServerTipScaleTween.Stop(); m_ServerTipPositionTween.Stop(); m_ServerTipScaleTween.SetStartState(); m_ServerTipPositionTween.SetStartState(); } readonly Regex autoPopRegex = new Regex("参数错误|执行GM命令错误|^###"); void DisplayGM(string latest) { if (!string.IsNullOrEmpty(latest)) { if (m_AutoPopToggle.isOn && hasOnFrom) { RectTransform rt = m_ContainerGM; Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0); rt.DOLocalMove(pos, 1.0f); hasOnFrom = !hasOnFrom; m_GMClose.SetActive(!hasOnFrom); } } if (m_ScrollControl.GetNumberOfCells(m_ScrollControl.m_Scorller) >= 300) { m_ScrollControl.m_Scorller.RefreshActiveCellViews(); return; } m_ScrollControl.Refresh(); for (int i = 0; i < ServerTipDetails.gmMessages.Count; i++) { m_ScrollControl.AddCell(ScrollerDataType.Normal, i); } m_ScrollControl.Restart(); if (autoPopRegex.IsMatch(latest)) { if (hasOnFrom) { OnGMOpen(); } } } private void OnRefreshGmCell(ScrollerDataType type, CellView cell) { if (cell.index < ServerTipDetails.gmMessages.Count) { Text text = cell.transform.Find("Text").GetComponent<Text>(); text.text = ServerTipDetails.gmMessages[cell.index]; } } private bool OnGetDynamicSize(ScrollerDataType type, int index, out float height) { var msg = index < ServerTipDetails.gmMessages.Count ? ServerTipDetails.gmMessages[index] : string.Empty; height = m_GmRichText.cachedTextGeneratorForLayout.GetPreferredHeight(msg, m_GmRichText.GetGenerationSettings(new Vector2(m_GmRichText.rectTransform.rect.size.x, 0.0f))) / m_GmRichText.pixelsPerUnit; height += 5; return true; } private void OnGMClose() { if (!hasOnFrom) { RectTransform rt = m_ContainerGM; Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0); rt.DOLocalMove(pos, 1.0f); hasOnFrom = !hasOnFrom; m_GMClose.SetActive(!hasOnFrom); } } private Vector3 gmTo = new Vector3(442, 0, 0); private Vector3 gmFrom = new Vector3(892, 0, 0); private bool hasOnFrom = true; public void OnGMOpen() { RectTransform rt = m_ContainerGM; Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0); rt.DOLocalMove(pos, 1.0f); hasOnFrom = !hasOnFrom; m_GMClose.SetActive(!hasOnFrom); } void CheckChatHint() { var hint = ServerTipDetails.RequireChatHint(); if (hint != null) { DisplayChatHint(hint); } } void DisplayChatHint(SystemHintData hint) { // TODO YYL // if (!UIManager.Instance.IsOpened<ChatWin>()) // { // return; // } // var hint = ServerTipDetails.RequireServerTip(); // if (hint != null && gameObject.activeInHierarchy) // { // DisplayServerHint(hint); // } // else // { // DisableServerTip(); // } // } // public void DisplayServerHint(SystemHintData hint) // { // transform.SetAsLastSibling(); // m_ServerTipPrepared = false; // if (!m_ServerTipScaleTween.gameObject.activeSelf) // { // m_ServerTipScaleTween.SetActive(true); // } // m_ServerTipScaleTween.SetStartState(); // m_ServerTipPositionTween.SetStartState(); // m_ContainerServerTip.SetActive(true); // m_ServerTip.SetExtenalData(hint.extentionData); // m_ServerTip.text = hint.message; // m_ServerTipScaleTween.Play(); // TimeMgr.Instance.Register(m_ServerTip, ServerTipStartHide, m_ServerTipKeepTime + m_ServerTipScaleTween.duration); // } // private void ServerTipStartHide(Component comp) // { // m_ServerTipPositionTween.Play(); // TimeMgr.Instance.Register(m_ServerTipPositionTween, ServerTipTweenComplete, m_ServerTipPositionTween.duration); // } // private void ServerTipTweenComplete(Component comp) // { // m_ServerTipPrepared = true; // DisableServerTip(); // CheckServerHint(); // } // private void DisableServerTip() // { // TimeMgr.Instance.UnRegister(m_ServerTip); // TimeMgr.Instance.UnRegister(m_ServerTipPositionTween); // m_ContainerServerTip.SetActive(false); // m_ServerTipScaleTween.Stop(); // m_ServerTipPositionTween.Stop(); // m_ServerTipScaleTween.SetStartState(); // m_ServerTipPositionTween.SetStartState(); // } // #region GM // readonly Regex autoPopRegex = new Regex("参数错误|执行GM命令错误|^###"); // void DisplayGM(string latest) // { // if (!string.IsNullOrEmpty(latest)) // { // if (m_AutoPopToggle.isOn && hasOnFrom) // { // RectTransform rt = m_ContainerGM; // Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0); // rt.DOLocalMove(pos, 1.0f); // hasOnFrom = !hasOnFrom; // m_GMClose.SetActive(!hasOnFrom); // } // } // if (m_ScrollControl.GetNumberOfCells(m_ScrollControl.m_Scorller) >= 300) // { // m_ScrollControl.m_Scorller.RefreshActiveCellViews(); // return; // } // m_ScrollControl.Refresh(); // for (int i = 0; i < ServerTipDetails.gmMessages.Count; i++) // { // m_ScrollControl.AddCell(ScrollerDataType.Normal, i); // } // m_ScrollControl.Restart(); // if (autoPopRegex.IsMatch(latest)) // { // if (hasOnFrom) // { // OnGMOpen(); // } // } // } // private void OnRefreshGmCell(ScrollerDataType type, CellView cell) // { // if (cell.index < ServerTipDetails.gmMessages.Count) // { // Text text = cell.transform.Find("Text").GetComponent<Text>(); // text.text = ServerTipDetails.gmMessages[cell.index]; // } // } // private bool OnGetDynamicSize(ScrollerDataType type, int index, out float height) // { // var msg = index < ServerTipDetails.gmMessages.Count ? ServerTipDetails.gmMessages[index] : string.Empty; // height = m_GmRichText.cachedTextGeneratorForLayout.GetPreferredHeight(msg, // m_GmRichText.GetGenerationSettings(new Vector2(m_GmRichText.rectTransform.rect.size.x, 0.0f))) // / m_GmRichText.pixelsPerUnit; // height += 5; // return true; // } // private void OnGMClose() // { // if (!hasOnFrom) // { // RectTransform rt = m_ContainerGM; // Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0); // rt.DOLocalMove(pos, 1.0f); // hasOnFrom = !hasOnFrom; // m_GMClose.SetActive(!hasOnFrom); // } // } // #endregion // private void OnDisable() // { // m_ContainerNormalHint.SetActive(false); // m_ContainerChatHint.SetActive(false); // DisableServerTip(); // StopAllCoroutines(); // } // private Vector3 gmTo = new Vector3(442, 0, 0); // private Vector3 gmFrom = new Vector3(892, 0, 0); // private bool hasOnFrom = true; // public void OnGMOpen() // { // RectTransform rt = m_ContainerGM; // Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0); // rt.DOLocalMove(pos, 1.0f); // hasOnFrom = !hasOnFrom; // m_GMClose.SetActive(!hasOnFrom); // } // void CheckChatHint() // { // var hint = ServerTipDetails.RequireChatHint(); // if (hint != null) // { // DisplayChatHint(hint); // } // } // void DisplayChatHint(SystemHintData hint) // { // if (!WindowCenter.Instance.IsOpen<ChatWin>()) // { // return; // } // if (!m_ContainerChatHint.gameObject.activeInHierarchy) // { // m_ContainerChatHint.gameObject.SetActive(true); // } // m_NormalChatHint.SetExtenalData(hint.extentionData); // m_NormalChatHint.text = hint.message; // m_ContainerChatHint.DoWaitRestart(); // } // } // } if (!m_ContainerChatHint.gameObject.activeInHierarchy) { m_ContainerChatHint.gameObject.SetActive(true); } m_NormalChatHint.SetExtenalData(hint.extentionData); m_NormalChatHint.text = hint.message; m_ContainerChatHint.DoWaitRestart(); } } Main/System/Message/MessageWin.cs.meta
@@ -1,8 +1,7 @@ fileFormatVersion: 2 guid: d7426a87e4ad9af4a8fd4bbabab7c32d timeCreated: 1499772891 licenseType: Free MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 Main/System/Message/SysNotifyMgr.cs
New file @@ -0,0 +1,312 @@ using vnxbqy.UI; using System; using System.Collections; using System.Collections.Generic; using System.Text.RegularExpressions; using UnityEngine; using UnityEngine.UI; using Cysharp.Threading.Tasks; public class SysNotifyMgr : SingletonMonobehaviour<SysNotifyMgr> { /// <summary> /// 服务端下发的数据 /// </summary> // TODO YYL // private H0212_tagNotifyCode.tagNotifyStr[] sysNotifyMsg; private ArrayList tipInfoList = new ArrayList(); private Dictionary<string, Func<string, ArrayList, bool>> notifyConditionDict = new Dictionary<string, Func<string, ArrayList, bool>>(); public event Action<string, ArrayList> sysNotifyEvent; public event Action<string> OnSystemNotifyEvent; /// <summary> /// UserData去空格处理 /// </summary> public static Regex s_UserDataSpaceRegex = new Regex(@"'([0-9]+)':[ ]+\[(.*?)\]", RegexOptions.Singleline); private void Awake() { // TODO YYL // DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; // StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish; Co_Instance().Forget(); } private async UniTask Co_Instance() { await UniTask.Yield(); //TODO YYL // var instance = BattleHint.Instance; } private void LateUpdate() { #if UNITY_EDITOR if (Input.GetKeyDown(KeyCode.F3)) { ServerTipDetails.OpenGMPanel(); } #endif } protected override void OnDestroy() { base.OnDestroy(); // TODO YYL // DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent; // StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish; } private void OnStageLoadFinish() { ServerTipDetails.OnStageLoadFinish(); // TODO YYL // BattleHint.Instance.OnStageLoadFinish(); } private void BeforePlayerDataInitializeEvent() { // TODO YYL // ScrollTip.m_Hints.Clear(); ServerTipDetails.ClearHint(); } // // TODO YYL // public void ReceiveNotifyCode(H0212_tagNotifyCode vNetData) // { // if (vNetData != null) // { // sysNotifyMsg = vNetData.Pars; // tipInfoList.Clear(); // for (int i = 0; i < sysNotifyMsg.Length; i++) // { // if (sysNotifyMsg[i].Len != 0) // { // var _msg = sysNotifyMsg[i].Msg; // _msg = _msg.Replace(" ", string.Empty); // tipInfoList.Add(_msg); // } // else // { // tipInfoList.Add(sysNotifyMsg[i].MsgInt); // } // } // if (sysNotifyEvent != null) // { // sysNotifyEvent(vNetData.Msg, tipInfoList); // } // GetSysMsg(vNetData.Msg); // } // } void GetSysMsg(string key) { ///根据key从系统信息表取到消息类型 SysInfoConfig cfg = SysInfoConfig.Get(key); if (cfg == null) { #if UNITY_EDITOR string hint = Language.Get("L1093", key); // TODO YYL // ScrollTip.ShowTip(hint); // ChatCtrl.Inst.RevChatInfo(hint); #endif } else { if (!string.IsNullOrEmpty(cfg.richText)) { if (notifyConditionDict.ContainsKey(cfg.key)) { try { if (!notifyConditionDict[cfg.key](cfg.key, tipInfoList)) { return; } } catch (Exception e) { Debug.Log(e.StackTrace); } } AnalysisSysmsg(cfg); } if (OnSystemNotifyEvent != null) { OnSystemNotifyEvent(cfg.key); } } } public void RegisterCondition(string key, Func<string, ArrayList, bool> condition) { if (!notifyConditionDict.ContainsKey(key)) { notifyConditionDict.Add(key, condition); } } public void ShowTip(string key, params object[] msg) { SysInfoConfig cfg = SysInfoConfig.Get(key); if (cfg != null) { tipInfoList.Clear(); tipInfoList.AddRange(msg); AnalysisSysmsg(cfg); } } void AnalysisSysmsg(SysInfoConfig cfg) { SysNotifySound(cfg.sound); SysNotifyFx(cfg.effect); SysNotifyRichText(cfg.type, cfg.richText, cfg.order); } void SysNotifySound(string msg) { //DesignDebug.Log("音效信息" + msg); } void SysNotifyFx(string msg) { //DesignDebug.Log("特效信息" + msg); } void SysNotifyRichText(int[] type, string msg, int order = 0) { if (type == null || type.Length == 0) { return; } for (int i = 0; i < type.Length; i++) { switch ((SysNotifyType)type[i]) { case SysNotifyType.SysFixedTip: case SysNotifyType.SysFixedTip1: case SysNotifyType.SysScrollTip: case SysNotifyType.SysIntervalFixedTip: case SysNotifyType.SysMarqueeTip: case SysNotifyType.SysRealmTip: // TODO YYL // if (!PreFightMission.Instance.IsFinished()) // { // continue; // } break; } switch ((SysNotifyType)type[i]) { case SysNotifyType.SysFixedTip: ServerTipDetails.DisplayNormalTip(msg, tipInfoList); break; case SysNotifyType.SysChatWin: ServerTipDetails.DisplayChatTip(msg, tipInfoList); break; case SysNotifyType.SysFixedTip1: case SysNotifyType.SysScrollTip: // TODO YYL // ScrollTip.ShowTip(msg, tipInfoList, order); break; case SysNotifyType.SysIntervalFixedTip: ServerTipDetails.ShowServerTip(msg, tipInfoList, order); break; case SysNotifyType.SysMarqueeTip: ServerTipDetails.ShowMarquee(msg, tipInfoList,order); break; // TODO YYL // case SysNotifyType.SysChanelTip: // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList); // break; // case SysNotifyType.SysFairyQuestionTip: // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.FairyQuestion); // break; // case SysNotifyType.SysFairyTip: // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.FairyTip); // break; // case SysNotifyType.SysTeamTip: // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.TeamTip); // break; case SysNotifyType.SysRealmTip: if (OnSysTipEvent != null) { OnSysTipEvent(type[i], msg, tipInfoList); } break; // TODO YYL // case SysNotifyType.SysEvenKill: // BattleHint.Instance.ReceiveEvenKill(msg, tipInfoList); // break; // case SysNotifyType.SysFactionTip: // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.default2); // break; } } } #region 事件 public static event Action<int, string, ArrayList> OnSysTipEvent; #endregion public enum SysNotifyType { SysFixedTip = 1,//固定提示 SysScrollTip = 2,//滚动提示 SysIntervalFixedTip = 4,//全服固定消息提示 SysMarqueeTip = 5,//跑马灯 SysChatWin = 6, //聊天位置的提示 SysEvenKill = 7,//上古战场连杀提示 SysFixedTip1 = 11,//固定提示2 SysChanelTip = 20,//系统频道显示 SysFairyQuestionTip = 31,//仙盟频道问答提示 SysFairyTip = 32,//仙盟频道信息提示 SysTeamTip = 41,//队伍频道提示 SysFactionTip = 51, //阵营频道提示 SysRealmTip = 100,//境界提示 //后续IL开发添加预设 default1 = 200, default2, default3, default4, default5, default6, default7, default8, default9, default10, } public int Compare(SystemHintData x, SystemHintData y) { if (x.order.CompareTo(y.order) != 0) { return -x.order.CompareTo(y.order); } return x.appendTime.CompareTo(y.appendTime); } } public class SystemHintData { public DateTime appendTime; public string message; public ArrayList extentionData; public int order; } Main/System/Message/SysNotifyMgr.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 08ac47bafc115db42959baf190cbaad1 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Message/WaitCallBack.cs
@@ -2,8 +2,6 @@ using System.Collections.Generic; using UnityEngine; namespace CJ.Wait { /// <summary> /// 延迟几秒执行事件 /// </summary> @@ -165,7 +163,6 @@ if (wait != null) { wait.waitTime = time; } } } } Main/System/Redpoint/Redpoint.cs
@@ -2,8 +2,6 @@ using System.Collections.Generic; using UnityEngine; namespace vnxbqy.UI { public class Redpoint { @@ -64,5 +62,3 @@ public int RedpoindId { get; internal set; } } } Main/System/Redpoint/RedpointBehaviour.cs
@@ -6,8 +6,6 @@ using System.Collections; using UnityEngine.UI; namespace vnxbqy.UI { public class RedpointBehaviour : MonoBehaviour { @@ -116,7 +114,6 @@ } } Main/System/Redpoint/RedpointCenter.cs
@@ -3,8 +3,6 @@ using UnityEngine; using System; namespace vnxbqy.UI { public class RedpointCenter : Singleton<RedpointCenter> { @@ -130,5 +128,3 @@ } } } Main/System/Tip.metacopy from Main/UI/Launch.meta copy to Main/System/Tip.meta
File was copied from Main/UI/Launch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 guid: 91e90d274ca17e84aab980cb88d23de7 guid: 8572fb4f5fe742341921a0b8f25be8e2 folderAsset: yes DefaultImporter: externalObjects: {} Main/System/Tip/MarqueeWin.cs
New file @@ -0,0 +1,134 @@ using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using DG.Tweening; using Cysharp.Threading.Tasks; public class MarqueeWin : UIBase { // 组件引用 [SerializeField] RectTransform m_ContainerMarquee; [SerializeField] RichText marqueeText; [SerializeField] RectTransform marqueeBg; [SerializeField] TweenCurve tweenCurve; [SerializeField] UIEffect m_Effect; Vector3 fromPos; Vector3 toPos; float m_Time; float duration; int presentCnt = 0; int loopCnt = 1; [SerializeField] float speed = 5.0f; Coroutine cacheCoroutine = null; // 生命周期 protected override void Awake() { base.Awake(); // 初始化组件引用 fromPos = marqueeText.rectTransform.localPosition; } protected override void Start() { base.Start(); // 初始化数据 } protected override void OnPreOpen() { // 子类可以重写此方法进行额外的预打开操作 base.OnPreOpen(); m_Time = 0; ServerTipDetails.OnTweening = false; presentCnt = 0; m_ContainerMarquee.SetActive(false); if (cacheCoroutine != null) { StopCoroutine(cacheCoroutine); cacheCoroutine = null; } } // UI事件 protected override void OnOpen() { base.OnOpen(); // 窗口打开时的逻辑 m_Effect.Play(); cacheCoroutine = StartCoroutine(Co_StartTween()); } protected override void OnClose() { base.OnClose(); // 窗口关闭时的逻辑 } IEnumerator Co_StartTween() { yield return new WaitForSeconds(5f); m_ContainerMarquee.SetActive(true); BeginMarquee(); } void BeginMarquee() { if (presentCnt == 0) { var _hint = ServerTipDetails.RequireMarquee(); if (_hint != null) { presentCnt = 0; marqueeText.SetExtenalData(_hint.extentionData); marqueeText.text = _hint.message; } else { CloseWindow(); return; } } presentCnt++; marqueeText.rectTransform.localPosition = fromPos; toPos = fromPos; float width = marqueeText.preferredWidth; toPos.x = fromPos.x - marqueeBg.rect.width - width; duration = (width + marqueeBg.rect.width) / speed; ServerTipDetails.OnTweening = true; } void OnTweenComp() { m_Time = 0; ServerTipDetails.OnTweening = false; if (presentCnt >= loopCnt) { presentCnt = 0; } BeginMarquee(); } protected void LateUpdate() { if (ServerTipDetails.OnTweening) { m_Time += Time.deltaTime; if (m_Time <= duration) { float progress = tweenCurve.Evaluate(m_Time / duration); marqueeText.rectTransform.localPosition = Vector3.Lerp(fromPos, toPos, progress); } else { OnTweenComp(); } } } } Main/System/Tip/MarqueeWin.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 33cf9ecf61018054ead9a0dcc8f3d121 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/System/Tip/ServerTipDetails.cs
New file @@ -0,0 +1,255 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using Cysharp.Threading.Tasks; public class ServerTipDetails { #region 跑马灯 public static bool OnTweening = false; private static List<SystemHintData> m_Marquees = new List<SystemHintData>(); public static void ShowMarquee(string msg, ArrayList info, int _order, int loopCnt = 1) { m_Marquees.Add(new SystemHintData() { appendTime = DateTime.Now, message = msg, extentionData = info == null ? info : new ArrayList(info), order = _order }); m_Marquees.Sort(SysNotifyMgr.Instance.Compare); if (!CheckOpenMarquee()) { return; } if (!UIManager.Instance.IsOpened<MarqueeWin>()) { UIManager.Instance.OpenWindow<MarqueeWin>(); } } public static void OnStageLoadFinish() { // if (StageLoad.Instance.currentStage is LoginStage) // { // m_Marquees.Clear(); // return; // } Co_StageLoadFinish().Forget(); } private static async UniTask Co_StageLoadFinish() { await UniTask.Yield(); if (CheckOpenMarquee() && m_Marquees.Count > 0) { if (!UIManager.Instance.IsOpened<MarqueeWin>()) { UIManager.Instance.OpenWindow<MarqueeWin>(); } } } static bool CheckOpenMarquee() { return true; // TODO YYL // return (StageLoad.Instance.currentStage is DungeonStage) && !StageLoad.Instance.isLoading; } public static SystemHintData RequireMarquee() { if (m_Marquees.Count > 0) { var _hint = m_Marquees[0]; m_Marquees.RemoveAt(0); return _hint; } return null; } #endregion #region 固定全服消息 private static List<SystemHintData> serverHints = new List<SystemHintData>(); public static event Action serverHintRefresh; public static void ShowServerTip(string msg, ArrayList info, int order) { serverHints.Add(new SystemHintData() { message = msg, order = order, extentionData = info == null ? info : new ArrayList(info), appendTime = DateTime.Now, }); serverHints.Sort(SysNotifyMgr.Instance.Compare); if (serverHintRefresh != null) { serverHintRefresh(); } if (!UIManager.Instance.IsOpened<MessageWin>()) { UIManager.Instance.OpenWindow<MessageWin>(); } } public static SystemHintData RequireServerTip() { if (serverHints.Count > 0) { var hint = serverHints[0]; serverHints.RemoveAt(0); return hint; } return null; } #endregion #region 普通信息提示 private static List<SystemHintData> normalHints = new List<SystemHintData>(); public static event Action normalHintRefresh; public static void DisplayNormalTip(string msg, ArrayList info = null) { normalHints.Clear(); normalHints.Add(new SystemHintData() { message = msg, order = 0, extentionData = info == null ? info : new ArrayList(info), appendTime = DateTime.Now, }); if (normalHintRefresh != null) { normalHintRefresh(); } if (!UIManager.Instance.IsOpened<MessageWin>()) { UIManager.Instance.OpenWindow<MessageWin>(); } } public static SystemHintData RequireNormalHint() { if (normalHints.Count > 0) { var hint = normalHints[0]; normalHints.RemoveAt(0); return hint; } return null; } #endregion #region 聊天界面信息提示 private static List<SystemHintData> chatHints = new List<SystemHintData>(); public static event Action chatHintRefresh; public static void DisplayChatTip(string msg, ArrayList info = null) { chatHints.Clear(); chatHints.Add(new SystemHintData() { message = msg, order = 0, extentionData = info == null ? info : new ArrayList(info), appendTime = DateTime.Now, }); if (chatHintRefresh != null) { chatHintRefresh(); } if (!UIManager.Instance.IsOpened<MessageWin>()) { UIManager.Instance.OpenWindow<MessageWin>(); } } public static SystemHintData RequireChatHint() { if (chatHints.Count > 0) { var hint = chatHints[0]; chatHints.RemoveAt(0); return hint; } return null; } #endregion #region GM消息 public static List<string> gmMessages = new List<string>(); public static event Action<string> gmMessageRefresh; public static void ReceivePackage(string message) { message = message.Replace("###", string.Empty); if (gmMessages.Count >= 300) { gmMessages.RemoveAt(0); } gmMessages.Add(message); if (gmMessageRefresh != null) { gmMessageRefresh(message); } } public static event Action gmOpenEvent; public static bool requireOpenGM; public static void OpenGMPanel() { requireOpenGM = true; if (!UIManager.Instance.IsOpened<MessageWin>()) { UIManager.Instance.OpenWindow<MessageWin>(); } else { if (gmOpenEvent != null) { gmOpenEvent(); } } } #endregion public static void ClearHint() { serverHints.Clear(); m_Marquees.Clear(); // queueTrumpetTips.Clear(); normalHints.Clear(); chatHints.Clear(); } // #region 喇叭信息 // private static Queue<ChatTrumpetData> queueTrumpetTips = new Queue<ChatTrumpetData>(); // public static void ShowTrumpetTip(ChatTrumpetData trumpetData) // { // queueTrumpetTips.Enqueue(trumpetData); // if (!UIManager.Instance.IsOpened<TrumpetWin>()) // { // UIManager.Instance.OpenWindow<TrumpetWin>(); // } // } // public static ChatTrumpetData RequireTrumpetTip() // { // if (queueTrumpetTips.Count > 0) // { // return queueTrumpetTips.Dequeue(); // } // return null; // } // public static int GetTrumpetSurplusCnt() // { // return queueTrumpetTips.Count; // } // #endregion } Main/System/Tip/ServerTipDetails.cs.meta
New file @@ -0,0 +1,11 @@ fileFormatVersion: 2 guid: 618febf3610033745acf7530fc007966 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant: Main/UI/Decorate.meta
File was renamed from Main/UI/Launch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 guid: 91e90d274ca17e84aab980cb88d23de7 guid: 7afe0dfa12d3fb54d95a2563bc0e019e folderAsset: yes DefaultImporter: externalObjects: {} Main/UI/Login.meta
File was deleted