From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs | 178 +++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs (limited to 'Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs') diff --git a/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs b/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs new file mode 100644 index 00000000..db19b914 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/X3DTouchMgr.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using KKSG; +using MiniJSON; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class X3DTouchMgr : XSingleton + { + private float _last_touch_time = 0f; + + private float _pointx = 0f; + + private float _pointy = 0f; + + public void OnProcess3DTouch(string msg = "") + { + bool flag = Time.time - this._last_touch_time < 1f; + if (!flag) + { + this._last_touch_time = Time.time; + bool flag2 = XSingleton.singleton.IsRecording() || XSingleton.singleton.IsInRecordingState; + if (!flag2) + { + bool flag3 = !XSingleton.singleton.IsSystemOpened(XSysDefine.XSys_Photo); + if (!flag3) + { + XSingleton.singleton.AddLog("The dict: ", msg, null, null, null, null, XDebugColor.XDebug_None); + bool flag4 = !string.IsNullOrEmpty(msg); + if (flag4) + { + Dictionary dictionary = Json.Deserialize(msg) as Dictionary; + bool flag5 = dictionary != null && dictionary.ContainsKey("data"); + if (flag5) + { + Dictionary dictionary2 = dictionary["data"] as Dictionary; + bool flag6 = dictionary2 != null; + if (flag6) + { + bool flag7 = dictionary2.ContainsKey("index_x") && dictionary2["index_x"] != null; + if (flag7) + { + string s = dictionary2["index_x"].ToString(); + float.TryParse(s, out this._pointx); + } + bool flag8 = dictionary2.ContainsKey("index_y") && dictionary2["index_y"] != null; + if (flag8) + { + string s2 = dictionary2["index_y"].ToString(); + float.TryParse(s2, out this._pointy); + } + float num = 2f; + bool flag9 = Screen.height == 1080 && Screen.width == 1920; + if (flag9) + { + num = 2.6f; + } + this._pointx *= num; + this._pointy = (float)Screen.height - this._pointy * num; + } + } + } + XSingleton.singleton.AddLog("Process 3d touch", null, null, null, null, null, XDebugColor.XDebug_None); + bool flag10 = XSingleton.singleton.IsPVPScene() || XSingleton.singleton.IsPVEScene(); + if (flag10) + { + bool flag11 = XSingleton.singleton.GameCamera != null && XSingleton.singleton.Player != null; + if (flag11) + { + Vector2 vector; + vector= new Vector3(this._pointx, this._pointy); + XSingleton.singleton.AddLog("Touch screen pos: ", vector.x.ToString(), ", y:", vector.y.ToString(), null, null, XDebugColor.XDebug_None); + XSingleton.singleton.AddLog("Is touch on ui: ", XTouch.PointOnUI(vector).ToString(), null, null, null, null, XDebugColor.XDebug_None); + bool flag12 = !XTouch.PointOnUI(vector); + if (flag12) + { + bool flag13 = XSingleton.singleton.Feeding && vector.x <= (float)(Screen.width / 2); + if (!flag13) + { + bool flag14 = XSingleton.singleton.GameCamera.BackToPlayer(); + bool flag15 = !flag14; + if (flag15) + { + XSingleton.singleton.ShowSystemTip(XSingleton.singleton.GetString("ERR_CAMERA_ROT"), "fece00"); + } + } + } + } + } + else + { + SceneType sceneType = XSingleton.singleton.SceneType; + if (sceneType <= SceneType.SCENE_GUILD_HALL) + { + if (sceneType != SceneType.SCENE_HALL && sceneType != SceneType.SCENE_GUILD_HALL) + { + goto IL_348; + } + } + else if (sceneType != SceneType.SCENE_FAMILYGARDEN && sceneType != SceneType.SCENE_LEISURE) + { + goto IL_348; + } + this.OnProcessScreenShot(msg); + IL_348:; + } + } + } + } + } + + private void OnProcessScreenShot(string msg) + { + bool flag = XSingleton.singleton.Feeding && this._pointx <= (float)(Screen.width / 2); + if (!flag) + { + bool flag2 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (!flag2) + { + bool flag3 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (!flag3) + { + bool flag4 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (!flag4) + { + bool flag5 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (!flag5) + { + bool flag6 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag6) + { + DlgBase.singleton.SetVisible(false, true); + } + bool flag7 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag7) + { + DlgBase.singleton.SetVisible(false, true); + } + bool flag8 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag8) + { + DlgBase.singleton.SetVisibleWithAnimation(false, null); + } + bool flag9 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible(); + if (flag9) + { + DlgBase.singleton.SetVisible(false, true); + } + bool flag10 = DlgBase.singleton.IsLoaded() && DlgBase.singleton.IsVisible() && DlgBase.singleton.fakeShow; + if (flag10) + { + DlgBase.singleton.SetVisible(true, true); + DlgBase.singleton.ShowMainView(); + } + else + { + bool flag11 = DlgBase.singleton.IsInReadyScreenShowView(); + if (flag11) + { + DlgBase.singleton.IOS3DTouchScreenShot(); + } + } + } + } + } + } + } + } + + private void OnCameraStraightForward() + { + } + } +} -- cgit v1.1-26-g67d0