Browse Source

修改了 进入房间的点击效果 以及增加了断线重连

胡佳骏 1 year ago
parent
commit
089de2ea41

+ 1 - 1
Assets/StreamingAssets/build_info

@@ -1 +1 @@
-Build from YUNYUNGEGE at 2023/9/13 11:37:18
+Build from YUNYUNGEGE at 2023/9/20 14:56:23

+ 29 - 8
Assets/Studio/MediaSoup/WebSocket/WSHandler.cs

@@ -87,15 +87,30 @@ public class WSHandler
     private static void OnError(WebSocket ws, Exception ex)
     {
         clientClosed();
-        CommonMethod.ShowPopUp(PopType.Normal, LanguageMgr.Instance.GetMessage("1059").Message, LanguageMgr.Instance.GetMessage("1104").Message, () =>
-        { LoadLoginSence(); }, LanguageMgr.Instance.GetMessage("1066").Message);
+        Debug.Log("OnErrorOnErrorOnErrorOnErrorOnErrorOnError"+ ex.Message);
+        CommonMethod.ShowTextTusi();
+        if (TuSi.Instance)
+        {
+            TuSi.Instance.ShowTextContent("大厅服务器网络不佳,正在重连。");
+            //LanguageMgr.Instance.GetMessage("1056").Message
+        }
+        //    CommonMethod.ShowPopUp(PopType.Normal, LanguageMgr.Instance.GetMessage("1059").Message, LanguageMgr.Instance.GetMessage("1104").Message, () =>
+        //   { LoadLoginSence(); }, LanguageMgr.Instance.GetMessage("1066").Message);
+        TimerMgr.Instance.CreateTimer(()=> { init(); },1f);
     }
 
     private static void OnWebErrorClosed(string data)
     {
         clientClosed();
-        CommonMethod.ShowPopUp(PopType.Normal, LanguageMgr.Instance.GetMessage("1059").Message, LanguageMgr.Instance.GetMessage("1104").Message, () =>
-        { LoadLoginSence(); }, LanguageMgr.Instance.GetMessage("1066").Message);
+        CommonMethod.ShowTextTusi();
+        if (TuSi.Instance)
+        {
+            TuSi.Instance.ShowTextContent("大厅服务器网络不佳,正在重连。");
+            //LanguageMgr.Instance.GetMessage("1056").Message
+        }
+        //    CommonMethod.ShowPopUp(PopType.Normal, LanguageMgr.Instance.GetMessage("1059").Message, LanguageMgr.Instance.GetMessage("1104").Message, () =>
+        //   { LoadLoginSence(); }, LanguageMgr.Instance.GetMessage("1066").Message);
+        TimerMgr.Instance.CreateTimer(() => { init(); }, 1f);
     }
 
     public static void clientClosed()
@@ -200,6 +215,7 @@ public class WSHandler
     public static void OnRoomRtcWebErrorClosed(string message)
     {
         roomCloes();
+        Debug.Log("OnRoomRtcWebErrorClosedOnRoomRtcWebErrorClosedOnRoomRtcWebErrorClosedOnRoomRtcWebErrorClosedOnRoomRtcWebErrorClosed");
         CommonMethod.ShowPopUp(PopType.Normal, LanguageMgr.Instance.GetMessage("1059").Message, LanguageMgr.Instance.GetMessage("1104").Message, () =>
         { LoadLoginSence(); }, LanguageMgr.Instance.GetMessage("1066").Message);
     }
@@ -228,16 +244,21 @@ public class WSHandler
     public static void OnRoomWebErrorClosed(string message)
     {
         roomCloes();
-        CommonMethod.ShowPopUp(PopType.Normal, LanguageMgr.Instance.GetMessage("1059").Message, LanguageMgr.Instance.GetMessage("1104").Message, () =>
-        { LoadLoginSence(); }, LanguageMgr.Instance.GetMessage("1066").Message);
-        /*
+        Debug.Log("OnRoomWebErrorClosedOnRoomWebErrorClosedOnRoomWebErrorClosedOnRoomWebErrorClosedOnRoomWebErrorClosedOnRoomWebErrorClosed"+ message);
+
+        CommonMethod.ShowTextTusi();
+        if (TuSi.Instance)
+        {
+            TuSi.Instance.ShowTextContent("房间服务器网络不佳,正在重连。");
+            //LanguageMgr.Instance.GetMessage("1056").Message
+        }
         TimerMgr.Instance.CreateTimer(() =>
         {
             roominit(_roomid);
             WSHandler.Room.OnInit -= onRoomInit;
             WSHandler.Room.OnInit += onRoomInit;
 
-        }, 1f);*/
+        }, 1f);
     }
 
     private static void onRoomInit(JsonData data)

File diff suppressed because it is too large
+ 133 - 0
Assets/Studio/Scenes/Hjj/LoginDlg.prefab


+ 1 - 1
Assets/Studio/XRLib/Codes/TestMVC/LoginDlg.cs

@@ -179,7 +179,7 @@ namespace ShadowStudio.UI
         private void OnClickLogin()
         {
 #if UNITY_EDITOR
-            userInputField.text = "ycst0001";
+            userInputField.text = "ycst0002";
             passwordInputField.text = "yc123456";
 #endif
             if (userInputField.text == "" || passwordInputField.text == "")

+ 32 - 11
Assets/Studio/_3HomeScene/HomeSceneScripts_new/UI/MenuIcon.cs

@@ -13,8 +13,9 @@ using DG.Tweening;
 using BeinLab.Util;
 using UnityEngine.EventSystems;
 using Studio.Scripts;
+using SC.XR.Unity.Module_InputSystem;
 
-public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
+public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
 {
     private DoubleLinkNode<RoomConfig> _dataConfig;
     /// <summary>
@@ -32,7 +33,7 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
     string _passWord;//房间密码
 
     bool isClick = false;//房间是否被点击
-    float _clickTime = 0.2f;//点击按下房间的间隔时间
+    float _clickTime = 0.5f;//点击按下房间的间隔时间
     float _lastTime = 0;//记录开始点击房间时所处的时间
     public bool _isDrag = false;//房间是否被拖拽
 
@@ -70,6 +71,26 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
     /// </summary>
     public static Vector3 itemPos;
 
+    public void Start()
+    {
+        DispatcherBase.KeyDownDelegateRegister(downEvent);
+        DispatcherBase.KeyUpDelegateRegister(upEvent);
+    }
+
+    private void upEvent(InputKeyCode keyCode, InputDevicePartBase part)
+    {
+        if (part.inputDataBase.SCPointEventData.pointerCurrentRaycast.gameObject != null && isDown)
+        {
+            isDown = false;
+            if (Time.time - _lastTime <= _clickTime)
+            {
+                ClickSelf();
+            }
+        }
+    }
+    private void downEvent(InputKeyCode keyCode, InputDevicePartBase part)
+    {
+    }
 
     public void Init()//初始化
     {
@@ -630,6 +651,8 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
 
     private void OnDestroy()
     {
+        DispatcherBase.KeyDownDelegateUnRegister(downEvent);
+        DispatcherBase.KeyUpDelegateUnRegister(upEvent);
         EventTool._displayDelete -= DisplayDeleteBtn;
 
         WSHandler.Room.OnInit -= onInit;
@@ -693,9 +716,10 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
             transform.DOScale(initAV3, 0.1f);
     }
 
-
+    bool isDown;
     public void OnPointerDown(PointerEventData eventData)
     {
+        isDown = true;
         _lastTime = Time.time;
         if (!isHide && !isRoomShow && isInit)
             //LeanTween.scale(this.gameObject, initAV3 * 0.9f, 0.1f);
@@ -706,16 +730,13 @@ public class MenuIcon : MonoBehaviour, IPointerDownHandler, IPointerClickHandler
     public void OnPointerClick(PointerEventData eventData)
     {
 
-        if (Time.time - _lastTime <= _clickTime)
-        {
-            if (!_isDrag)
-            {
-                ClickSelf();
-            }
-        }
-
         if (!isHide && !isRoomShow && isInit)
             //LeanTween.scale(this.gameObject, initAV3, 0.1f);.
             transform.DOScale(initAV3, 0.1f);
     }
+
+    public void OnPointerUp(PointerEventData eventData)
+    {
+
+    }
 }

+ 1 - 0
Assets/Studio/_4ShowScene/ConsoleFunctionModule/DrawPenFunctionModule/ColorPaletteDlg.cs

@@ -119,6 +119,7 @@ namespace ShadowStudio.UI
 
         private static Color GetSaturation(Color color, float x, float y)
         {
+            Debug.Log("GetSaturationGetSaturationGetSaturationGetSaturationGetSaturationGetSaturationGetSaturationGetSaturationGetSaturation");
             Color newColor = Color.white;
             for (int i = 0; i < 3; i++)
             {

+ 1 - 2
Assets/XR/XRGeneralSettings.asset

@@ -43,8 +43,7 @@ MonoBehaviour:
   m_RequiresSettingsUpdate: 0
   m_AutomaticLoading: 0
   m_AutomaticRunning: 0
-  m_Loaders:
-  - {fileID: 11400000, guid: e1339d3b24f7bd145a9ec425510ff76d, type: 2}
+  m_Loaders: []
 --- !u!114 &11400000
 MonoBehaviour:
   m_ObjectHideFlags: 0

Some files were not shown because too many files changed in this diff