Explorar el Código

unity-lib-update

lvjincheng hace 3 años
padre
commit
d772c186e4
Se han modificado 49 ficheros con 110 adiciones y 413 borrados
  1. 2 2
      Assets/BowArrow/Modules/NewUserGuider/NewUserGuiderManager.cs
  2. 3 3
      Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs
  3. 1 1
      Assets/BowArrow/Scripts/Components/ImageAutoLanguage.cs
  4. 4 4
      Assets/BowArrow/Scripts/Debug/SBLogger.cs
  5. 2 2
      Assets/BowArrow/Scripts/Entry.cs
  6. 1 1
      Assets/BowArrow/Scripts/Expand/PersistenHandler.cs
  7. 1 1
      Assets/BowArrow/Scripts/Expand/SB_EventSystem/MouseConfirm/MouseConfirm.cs
  8. 1 1
      Assets/BowArrow/Scripts/Expand/UserGameAnalyse.cs
  9. 1 1
      Assets/BowArrow/Scripts/Game/BowCamera.cs
  10. 1 1
      Assets/BowArrow/Scripts/GameChallenge/Animals/Rabbit.cs
  11. 2 2
      Assets/BowArrow/Scripts/GameChallenge/Views/HunterGameSettleView.cs
  12. 1 1
      Assets/BowArrow/Scripts/GameMode/RabbitHuntGameMode_OnlinePK.cs
  13. 1 1
      Assets/BowArrow/Scripts/GameMode/WolfHuntGameMode_OnlinePK.cs
  14. 1 1
      Assets/BowArrow/Scripts/GameMode/YejiHuntGameMode_OnlinePK.cs
  15. 1 1
      Assets/BowArrow/Scripts/Manager/LoginMgr/LoginMgr.cs
  16. 5 5
      Assets/BowArrow/Scripts/Manager/LoginMgr/LoginView.cs
  17. 5 5
      Assets/BowArrow/Scripts/Manager/LoginMgr/RegisterView.cs
  18. 1 1
      Assets/BowArrow/Scripts/Network/HttpController/CaptchaController.cs
  19. 1 1
      Assets/BowArrow/Scripts/Network/HttpController/LoginController.cs
  20. 1 1
      Assets/BowArrow/Scripts/Network/SocketComp/PKComp.cs
  21. 1 1
      Assets/BowArrow/Scripts/Network/SocketComp/RankComp.cs
  22. 1 1
      Assets/BowArrow/Scripts/Network/SocketComp/UserComp.cs
  23. 4 4
      Assets/BowArrow/Scripts/Network/UserPlayer.cs
  24. 2 2
      Assets/BowArrow/Scripts/Util/TimeUtil.cs
  25. 1 1
      Assets/BowArrow/Scripts/View/AboutUsView.cs
  26. 1 1
      Assets/BowArrow/Scripts/View/ChallengeOptionView.cs
  27. 1 1
      Assets/BowArrow/Scripts/View/DeviceBatteryView.cs
  28. 2 2
      Assets/BowArrow/Scripts/View/DeviceCalibrateView.cs
  29. 2 2
      Assets/BowArrow/Scripts/View/FriendView.cs
  30. 2 2
      Assets/BowArrow/Scripts/View/GameStartView.cs
  31. 1 1
      Assets/BowArrow/Scripts/View/MeView.cs
  32. 2 2
      Assets/BowArrow/Scripts/View/PKGameOptionView.cs
  33. 2 2
      Assets/BowArrow/Scripts/View/PKGameSettleView.cs
  34. 7 7
      Assets/BowArrow/Scripts/View/PKMatchingView.cs
  35. 1 1
      Assets/BowArrow/Scripts/View/RoleSelectView.cs
  36. 4 4
      Assets/BowArrow/Scripts/View/SetUpView1.cs
  37. 4 4
      Assets/BowArrow/Scripts/View/TopBarView.cs
  38. 2 3
      Assets/JC/JCEngine.cs
  39. 0 161
      Assets/JC/JCLib.cs
  40. 0 11
      Assets/JC/JCLib.cs.meta
  41. BIN
      Assets/JC/JCUnityLib.dll
  42. 33 0
      Assets/JC/JCUnityLib.dll.meta
  43. 0 18
      Assets/JC/Singleton.cs
  44. 0 11
      Assets/JC/Singleton.cs.meta
  45. 0 39
      Assets/JC/Untiy/CoroutineStarter.cs
  46. 0 11
      Assets/JC/Untiy/CoroutineStarter.cs.meta
  47. 0 29
      Assets/JC/Untiy/Debouncer.cs
  48. 0 11
      Assets/JC/Untiy/Debouncer.cs.meta
  49. 1 45
      Assets/JC/Untiy/UI/BackgroundAdapter.cs

+ 2 - 2
Assets/BowArrow/Modules/NewUserGuider/NewUserGuiderManager.cs

@@ -4,7 +4,7 @@ using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.SceneManagement;
-using JC.Unity.UI;
+using JCUnityLib;
 
 public class NewUserGuiderManager : MonoBehaviour
 {
@@ -621,7 +621,7 @@ public class NewUserGuiderManager : MonoBehaviour
                 Vector3 sidePos = RectTransformUtility.WorldToScreenPoint(Camera.main, sidePoint.position);
                 float sizeLen = Mathf.Abs(centerPos.x - sidePos.x) * 2;
                 iconRect.position = centerPos;
-                iconRect.sizeDelta = JC.Unity.UI.RectTransformUtils.ScreenV3ToCanvasV3(Vector3.one * sizeLen, iconRect); 
+                iconRect.sizeDelta = JCUnityLib.RectTransformUtils.ScreenV3ToCanvasV3(Vector3.one * sizeLen, iconRect); 
                 g.hollowOutMask.RefreshViewImmediate();
                 countDown -= Time.deltaTime;
                 if (countDown <= 0) {

+ 3 - 3
Assets/BowArrow/Scripts/Bluetooth/BluetoothAim.cs

@@ -227,7 +227,7 @@ public class BluetoothAim : MonoBehaviour
             {
                 // logger.Log(String.Join(",", value));
                 if (!hasData) {
-                    hasDataTime = JC.CS.Utility.GetTimestamp();
+                    hasDataTime = JCUnityLib.TimeUtils.GetTimestamp();
                     UploadMacAddress(value);
                 }
                 hasData = true;
@@ -303,7 +303,7 @@ public class BluetoothAim : MonoBehaviour
             BleUDP.ins.OnCharacteristicChanged = (byte[] value) =>
             {
                 if (!hasData) {
-                    hasDataTime = JC.CS.Utility.GetTimestamp();
+                    hasDataTime = JCUnityLib.TimeUtils.GetTimestamp();
                     UploadMacAddress(value);
                 }
                 hasData = true;
@@ -352,7 +352,7 @@ public class BluetoothAim : MonoBehaviour
     bool isSendCmdLocked = false;
     bool canAutoDormancy = false;
     bool isStartUp = false;
-    JC.CS.CountLocker needModularAwake = new JC.CS.CountLocker();
+    JCUnityLib.CountLock needModularAwake = new JCUnityLib.CountLock();
     void CheckAndStartUp()
     {
         if (needModularAwake.IsLocked())

+ 1 - 1
Assets/BowArrow/Scripts/Components/ImageAutoLanguage.cs

@@ -71,7 +71,7 @@ public class ImageAutoLanguage : MonoBehaviour
         if (matchRes != null) {
             imageComp.sprite = matchRes.sprite;
             if (resetSize) {
-                JC.Unity.UI.RectTransformUtils.SetRectTransformSize(
+                JCUnityLib.RectTransformUtils.SetRectTransformSize(
                     imageComp.transform as RectTransform, matchRes.size
                 );
             }

+ 4 - 4
Assets/BowArrow/Scripts/Debug/SBLogger.cs

@@ -16,24 +16,24 @@ public class SBLogger
     public void Log(object info) 
     {
         if (!debug) return;
-        JC.Unity.CoroutineStarter.Start(SendToServer(0, info));
+        JCUnityLib.CoroutineStarter.Start(SendToServer(0, info));
     }
 
     public void Warn(object info) 
     {
         if (!debug) return;
-        JC.Unity.CoroutineStarter.Start(SendToServer(1, info));
+        JCUnityLib.CoroutineStarter.Start(SendToServer(1, info));
     }
 
     public void Error(object info)
     {
         if (!debug) return;
-        JC.Unity.CoroutineStarter.Start(SendToServer(2, info));
+        JCUnityLib.CoroutineStarter.Start(SendToServer(2, info));
     }
 
     IEnumerator SendToServer(int level, object info)
     {
-        long time = JC.CS.Utility.GetTimestamp();
+        long time = JCUnityLib.TimeUtils.GetTimestamp();
         string txt = this.tag + " " + info;
         yield return null;
         if (level == 0) Debug.Log(txt);

+ 2 - 2
Assets/BowArrow/Scripts/Entry.cs

@@ -38,10 +38,10 @@ public class Entry : MonoBehaviour
         StartCoroutine(AsyncLoadScene());
 
         SceneManager.sceneUnloaded += (scene) => {
-            long t1 = JC.CS.Utility.GetTimestamp();
+            long t1 = JCUnityLib.TimeUtils.GetTimestamp();
             Resources.UnloadUnusedAssets();
             System.GC.Collect();
-            long t2 = JC.CS.Utility.GetTimestamp();
+            long t2 = JCUnityLib.TimeUtils.GetTimestamp();
             Debug.Log($"场景{scene.name}销毁,释放资源和GC回收的总耗时={t2 - t1}ms");
         };
 

+ 1 - 1
Assets/BowArrow/Scripts/Expand/PersistenHandler.cs

@@ -28,7 +28,7 @@ public class MenuBackController {
     {
         if (Input.GetKeyDown(KeyCode.Escape)) {
             long lastLast = lastPressExitTime;
-            lastPressExitTime = JC.CS.Utility.GetTimestamp();
+            lastPressExitTime = JCUnityLib.TimeUtils.GetTimestamp();
             if (lastPressExitTime - lastLast < 10 * 1000) {
                 OnTwiceBack();
             } else {

+ 1 - 1
Assets/BowArrow/Scripts/Expand/SB_EventSystem/MouseConfirm/MouseConfirm.cs

@@ -65,7 +65,7 @@ public class MouseConfirm : MonoBehaviour
         RectTransform rtf = _targetSelectable.transform as RectTransform;
         _btnTransition = btn.transition;
         if (btn.transition == Selectable.Transition.ColorTint) { //变色和放大
-            Vector3 pos = RectTransformUtils.GetPositionByPivot(rtf, Vector2.one * 0.5f);
+            Vector3 pos = JCUnityLib.RectTransformUtils.GetPositionByPivot(rtf, Vector2.one * 0.5f);
             rtf.pivot = Vector2.one * 0.5f;
             rtf.position = pos;
             _targetlocalScale = rtf.localScale;

+ 1 - 1
Assets/BowArrow/Scripts/Expand/UserGameAnalyse.cs

@@ -18,7 +18,7 @@ public class UserGameAnalyse : MonoBehaviour
 
     void Start()
     {
-        startTime = JC.CS.Utility.GetTimestamp();
+        startTime = JCUnityLib.TimeUtils.GetTimestamp();
         sceneTimeOnStart = Time.realtimeSinceStartup;
     }
 

+ 1 - 1
Assets/BowArrow/Scripts/Game/BowCamera.cs

@@ -27,7 +27,7 @@ public class BowCamera : MonoBehaviour
     //本地欧拉角记录值
     Vector3 localEulerAngles;
     //触摸检测器
-    JC.Unity.TouchChecker touchChecker = new JC.Unity.TouchChecker();
+    JCUnityLib.TouchChecker touchChecker = new JCUnityLib.TouchChecker();
     //触摸模式开关
     private static bool _isTouchMode = true;
     public static bool isTouchMode

+ 1 - 1
Assets/BowArrow/Scripts/GameChallenge/Animals/Rabbit.cs

@@ -178,7 +178,7 @@ public class Rabbit : TargetAnimal
         injuredID++;
     }
     
-    JC.CS.CountLocker hurtFlag = new JC.CS.CountLocker();
+    JCUnityLib.CountLock hurtFlag = new JCUnityLib.CountLock();
     void addHurtFlag() {
         hurtFlag.Lock();
         Invoke("clearOneHurtFlag", 5);

+ 2 - 2
Assets/BowArrow/Scripts/GameChallenge/Views/HunterGameSettleView.cs

@@ -37,7 +37,7 @@ public class HunterGameSettleView : MonoBehaviour
                 gameRes = 1; //玩家2胜利
             }
             try { 
-                RankComp.ins.uploadPKGameRes(gameRes);
+                RankComp.Instance.uploadPKGameRes(gameRes);
             } catch (System.Exception e) { Debug.LogError(e.Message); }
         }
         if (GlobalData.pkMatchType == PKMatchType.OnlinePK) {
@@ -62,7 +62,7 @@ public class HunterGameSettleView : MonoBehaviour
         }
     }
 
-    JC.CS.Throttler throttlerTryAgainOnline = new JC.CS.Throttler(3000);
+    JCUnityLib.Throttler throttlerTryAgainOnline = new JCUnityLib.Throttler(3000);
     public void TryAgain() {
         AudioMgr.ins.PlayBtn();
         if (GameAssistUI.ins) GameAssistUI.ins.recordPlayerRecordsWhenGameTryAgain();

+ 1 - 1
Assets/BowArrow/Scripts/GameMode/RabbitHuntGameMode_OnlinePK.cs

@@ -176,7 +176,7 @@ public class RabbitHuntGameMode_OnlinePK : RabbitHuntGameMode, ChallengeGameMode
             };
             socketPlayer.onReceivePKGameData = onReceivePKGameData;
             AutoSwitchBanUserControlBow();
-            JC.Unity.CoroutineStarter.Start(CheckAndUpload());
+            JCUnityLib.CoroutineStarter.Start(CheckAndUpload());
         }
         bool IsCanUpload() {
             return GameMgr.ins == gameMode.gameMgr && gameMode.gameMgr;

+ 1 - 1
Assets/BowArrow/Scripts/GameMode/WolfHuntGameMode_OnlinePK.cs

@@ -247,7 +247,7 @@ public class WolfHuntGameMode_OnlinePK : WolfHuntGameMode, ChallengeGameModeLoca
             };
             socketPlayer.onReceivePKGameData = onReceivePKGameData;
             AutoSwitchBanUserControlBow();
-            JC.Unity.CoroutineStarter.Start(CheckAndUpload());
+            JCUnityLib.CoroutineStarter.Start(CheckAndUpload());
         }
         bool IsCanUpload() {
             return GameMgr.ins == gameMode.gameMgr && gameMode.gameMgr;

+ 1 - 1
Assets/BowArrow/Scripts/GameMode/YejiHuntGameMode_OnlinePK.cs

@@ -177,7 +177,7 @@ public class YejiHuntGameMode_OnlinePK : YejiHuntGameMode, ChallengeGameModeLoca
             };
             socketPlayer.onReceivePKGameData = onReceivePKGameData;
             AutoSwitchBanUserControlBow();
-            JC.Unity.CoroutineStarter.Start(CheckAndUpload());
+            JCUnityLib.CoroutineStarter.Start(CheckAndUpload());
         }
         bool IsCanUpload() {
             return GameMgr.ins == gameMode.gameMgr && gameMode.gameMgr;

+ 1 - 1
Assets/BowArrow/Scripts/Manager/LoginMgr/LoginMgr.cs

@@ -64,7 +64,7 @@ public class UserInfo {
     public string guideRecord = "";
     public void Save()
     {
-        try { UserComp.ins.saveUserInfo(this); } catch (System.Exception e) { Debug.LogError(e.Message); }
+        try { UserComp.Instance.saveUserInfo(this); } catch (System.Exception e) { Debug.LogError(e.Message); }
     }
     public void SetChallengeLevelPass(int gameType, int level) {
         if (gameType != 3 && gameType != 4 && gameType != 5) return;

+ 5 - 5
Assets/BowArrow/Scripts/Manager/LoginMgr/LoginView.cs

@@ -128,14 +128,14 @@ public class LoginView : MonoBehaviour
     }
 
     public void ChnageCaptcha1() {
-        StartCoroutine(CaptchaController.ins.GetCaptcha(
+        StartCoroutine(CaptchaController.Instance.GetCaptcha(
             loginInCaptcha1.transform.Find("CodeImage").GetComponent<Image>(),
             (code) => { captcha_Login = code; }
         ));
     }
 
     public void ChnageCaptcha2() {
-        StartCoroutine(CaptchaController.ins.GetCaptcha(
+        StartCoroutine(CaptchaController.Instance.GetCaptcha(
             loginInCaptcha2.transform.Find("CodeImage").GetComponent<Image>(),
             (code) => { captcha_LoginPhone = code; }
         ));
@@ -149,7 +149,7 @@ public class LoginView : MonoBehaviour
         }
     }
 
-    JC.CS.Throttler throttlerLoginNormal = new JC.CS.Throttler(2000);
+    JCUnityLib.Throttler throttlerLoginNormal = new JCUnityLib.Throttler(2000);
     void LoginNormal() {
         InputField user = GetInputField(loginInUser);
         if (user.text.Trim().Length == 0) {
@@ -174,7 +174,7 @@ public class LoginView : MonoBehaviour
             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("操作过于频繁"));
             return;
         }
-        StartCoroutine(LoginController.ins.LoginNormal(
+        StartCoroutine(LoginController.Instance.LoginNormal(
             user.text, pwd.text, (res) => {
                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
                 if (res.code == 0) {
@@ -194,7 +194,7 @@ public class LoginView : MonoBehaviour
             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("手机号格式不正确"));
             return;
         }
-        StartCoroutine(LoginController.ins.LoginByPhone(
+        StartCoroutine(LoginController.Instance.LoginByPhone(
             user.text, (res) => {
                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
                 if (res.code == 0) {

+ 5 - 5
Assets/BowArrow/Scripts/Manager/LoginMgr/RegisterView.cs

@@ -77,7 +77,7 @@ public class RegisterView : MonoBehaviour
     }
 
     public void ChnageCaptcha() {
-        StartCoroutine(CaptchaController.ins.GetCaptcha(
+        StartCoroutine(CaptchaController.Instance.GetCaptcha(
             registerInCaptcha.transform.Find("CodeImage").GetComponent<Image>(),
             (code) => { captcha_Register = code; }
         ));
@@ -85,7 +85,7 @@ public class RegisterView : MonoBehaviour
 
     private string usrRecord = "";
     private string pwdRecord = "";
-    JC.CS.Throttler throttlerRegisterNext = new JC.CS.Throttler(2000);
+    JCUnityLib.Throttler throttlerRegisterNext = new JCUnityLib.Throttler(2000);
     public void RegisterNext()
     {
         InputField user = GetInputField(registerInUser);
@@ -118,7 +118,7 @@ public class RegisterView : MonoBehaviour
         }
         usrRecord = user.text;
         pwdRecord = pwd1.text;
-        StartCoroutine(LoginController.ins.Register(
+        StartCoroutine(LoginController.Instance.Register(
             usrRecord, pwdRecord, (res) => {
                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
                 if (res.code == 0) {
@@ -129,7 +129,7 @@ public class RegisterView : MonoBehaviour
         ));
     }
 
-    JC.CS.Throttler throttlerRegisterSave = new JC.CS.Throttler(2000);
+    JCUnityLib.Throttler throttlerRegisterSave = new JCUnityLib.Throttler(2000);
     public void RegisterSave() {
         InputField nickname = GetInputField(registerInNickname);
         if (nickname.text.Trim().Length == 0) {
@@ -162,7 +162,7 @@ public class RegisterView : MonoBehaviour
             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("操作过于频繁"));
             return;
         }
-        StartCoroutine(LoginController.ins.CompleteUserInfo(
+        StartCoroutine(LoginController.Instance.CompleteUserInfo(
             usrRecord, pwdRecord, nickname.text, gender, birthday.text,
             countryCode, stateCode, cityCode 
             ,(res) => {

+ 1 - 1
Assets/BowArrow/Scripts/Network/HttpController/CaptchaController.cs

@@ -6,7 +6,7 @@ using UnityEngine.Networking;
 using UnityEngine.UI;
 
 /* Http控制器-验证码 */
-public class CaptchaController : Singleton<CaptchaController>
+public class CaptchaController : JCUnityLib.Singleton<CaptchaController>
 {
     public IEnumerator GetCaptcha(Image targetRenderImage, Action<int> cb)
     {

+ 1 - 1
Assets/BowArrow/Scripts/Network/HttpController/LoginController.cs

@@ -6,7 +6,7 @@ using UnityEngine.Networking;
 using Newtonsoft.Json;
 
 /* Http控制器-登录 */
-public class LoginController : Singleton<LoginController>
+public class LoginController : JCUnityLib.Singleton<LoginController>
 {
     public IEnumerator LoginNormal(string username, string password, Action<RequestResult> callback) {
         string url = CommonConfig.businessServerURI + "/gameLogin/loginNormal";

+ 1 - 1
Assets/BowArrow/Scripts/Network/SocketComp/PKComp.cs

@@ -2,7 +2,7 @@ using System.Collections.Generic;
 using UnityEngine;
 
 /* Socket组件-PK */
-public class PKComp : Singleton<PKComp>
+public class PKComp : JCUnityLib.Singleton<PKComp>
 {
     public void randomMatch() {
         MatchPlayerInfo playerInfo = CreateMyMatchPlayerInfo();

+ 1 - 1
Assets/BowArrow/Scripts/Network/SocketComp/RankComp.cs

@@ -2,7 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 /* Socket组件-排行 */
-public class RankComp : Singleton<RankComp>
+public class RankComp : JCUnityLib.Singleton<RankComp>
 {
     public void uploadPKGameRes(int gameRes) {
         UserPlayer.ins.call(

+ 1 - 1
Assets/BowArrow/Scripts/Network/SocketComp/UserComp.cs

@@ -2,7 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 /* Socket组件-用户 */
-public class UserComp : Singleton<UserComp>
+public class UserComp : JCUnityLib.Singleton<UserComp>
 {
     public void getUserInfo(System.Action<UserInfo> cb) {
         UserPlayer.ins.call("userComp.getUserInfo", null, cb);

+ 4 - 4
Assets/BowArrow/Scripts/Network/UserPlayer.cs

@@ -10,7 +10,7 @@ public class UserPlayer : JCEntity
     public static UserPlayer ins;
     public UserPlayer() {
         ins = this;
-        components.Add("PKComp", PKComp.ins);
+        components.Add("PKComp", PKComp.Instance);
     }
     public static void ConnectServer() {
         if (ins != null) return;
@@ -38,14 +38,14 @@ public class UserPlayer : JCEntity
     public override void onDestroy() {
         Debug.Log("UserPlayer onDestroy()");
         if (canReconnnect) {
-            JC.Unity.CoroutineStarter.Start(ReconnenctServer());
+            JCUnityLib.CoroutineStarter.Start(ReconnenctServer());
         }
     }
 
     public override void onMiss() {
         Debug.Log("UserPlayer onMiss()");
         if (canReconnnect) {
-            JC.Unity.CoroutineStarter.Start(ReconnenctServer());
+            JCUnityLib.CoroutineStarter.Start(ReconnenctServer());
         }
     }
 
@@ -74,7 +74,7 @@ public class UserPlayer : JCEntity
     public void onAuthRes(bool res) {
         Debug.Log("onAuthRes," + res);
         if (res) {
-            UserComp.ins.getUserInfo(delegate(UserInfo userInfo) {
+            UserComp.Instance.getUserInfo(delegate(UserInfo userInfo) {
                 LoginMgr.myUserInfo = userInfo;
                 if (HomeView.ins) {
                     HomeView.ins.RenderMyAvatarSprite();

+ 2 - 2
Assets/BowArrow/Scripts/Util/TimeUtil.cs

@@ -27,7 +27,7 @@ public class TimeUtil
 
     public static string GetOfflineTimeStr(long offlineTime, bool online) {
         if (online) return TextAutoLanguage2.GetTextByKey("friend_offline-time_0");
-        long now = JC.CS.Utility.GetTimestamp();
+        long now = JCUnityLib.TimeUtils.GetTimestamp();
         long dt = now - offlineTime;
         if (dt < 0) dt = 0;
         if (offlineTime == 0) return TextAutoLanguage2.GetTextByKey("friend_offline-time_1");
@@ -53,7 +53,7 @@ public class TimeUtil
             output.SetTextKey("friend_offline-time_0");
             return;
         }
-        long now = JC.CS.Utility.GetTimestamp();
+        long now = JCUnityLib.TimeUtils.GetTimestamp();
         long dt = now - offlineTime;
         if (dt < 0) dt = 0;
         if (offlineTime == 0) {

+ 1 - 1
Assets/BowArrow/Scripts/View/AboutUsView.cs

@@ -6,7 +6,7 @@ public class AboutUsView : MonoBehaviour, MenuBackInterface
 {
     void Start()
     {
-        JC.Unity.UI.AdapterUtils.MakeRectTransformFullScreen(this);
+        JCUnityLib.RectTransformUtils.MakeRectTransformFullScreen(transform as RectTransform);
         PersistenHandler.ins?.menuBackCtr.views.Add(this);
     }
     void OnDestroy()

+ 1 - 1
Assets/BowArrow/Scripts/View/ChallengeOptionView.cs

@@ -25,7 +25,7 @@ public class ChallengeOptionView : MonoBehaviour, MenuBackInterface
             else if (gameType == 4) newGameType = 11;
             else if (gameType == 5) newGameType = 12;
             GlobalDataTemp.matchGameType = newGameType;
-            JC.Unity.UI.CanvasUtils.PlusSortOrder(
+            JCUnityLib.CanvasUtils.PlusSortOrder(
                 gameObject,
                 GameObject.Instantiate(SceneResMgr.ins.GetPrefab("PKMatchView")), 
                 1

+ 1 - 1
Assets/BowArrow/Scripts/View/DeviceBatteryView.cs

@@ -51,7 +51,7 @@ public class DeviceBatteryView : MonoBehaviour
     void RequestBatteryForBow()
     {
         try {
-            if (BluetoothAim.ins.hasData && JC.CS.Utility.GetTimestamp() - BluetoothAim.ins.hasDataTime > 5000) {
+            if (BluetoothAim.ins.hasData && JCUnityLib.TimeUtils.GetTimestamp() - BluetoothAim.ins.hasDataTime > 5000) {
                 BluetoothAim.ins.RequestBattery();
             }
         } catch (Exception) {}

+ 2 - 2
Assets/BowArrow/Scripts/View/DeviceCalibrateView.cs

@@ -199,9 +199,9 @@ public class DeviceCalibrateView : MonoBehaviour, MenuBackInterface
                         GameObject o = Instantiate(prefab_MagInterferenceTipView);
                         var nug = FindObjectOfType<NewUserGuider>(); //判断是否处于引导界面
                         if (nug && nug.gameObject && nug.gameObject.activeSelf) {
-                            JC.Unity.UI.CanvasUtils.PlusSortOrder(nug.gameObject, o, 1);     
+                            JCUnityLib.CanvasUtils.PlusSortOrder(nug.gameObject, o, 1);     
                         } else {
-                            JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+                            JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
                         }
                         //地磁干扰提示页面-end
                         PopupMgr.ins.ShowTipTop(TextAutoLanguage2.GetTextByKey("tip_mag-calibrate_please-leave-interfere"));

+ 2 - 2
Assets/BowArrow/Scripts/View/FriendView.cs

@@ -251,11 +251,11 @@ public class FriendView : MonoBehaviour, MenuBackInterface
         long _lastSearchTime = 0;
         public void btnEvent_SearchPlayer() {
             AudioMgr.ins.PlayBtn();
-            if (JC.CS.Utility.GetTimestamp() - _lastSearchTime < 3000) {
+            if (JCUnityLib.TimeUtils.GetTimestamp() - _lastSearchTime < 3000) {
                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("操作过于频繁"));
                 return;
             } else {
-                _lastSearchTime = JC.CS.Utility.GetTimestamp();
+                _lastSearchTime = JCUnityLib.TimeUtils.GetTimestamp();
             }
             string searchText = GetSearchInputField().text;
             Action<JArray> cb = delegate(JArray list) {

+ 2 - 2
Assets/BowArrow/Scripts/View/GameStartView.cs

@@ -32,7 +32,7 @@ public class GameStartView : MonoBehaviour, MenuBackInterface
         {
             case "闯关":
                 GlobalDataTemp.pkMatchType = PKMatchType.None;
-                JC.Unity.UI.CanvasUtils.PlusSortOrder(
+                JCUnityLib.CanvasUtils.PlusSortOrder(
                     gameObject,
                     GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/ChallengeOptionView")),
                     1
@@ -45,7 +45,7 @@ public class GameStartView : MonoBehaviour, MenuBackInterface
                 break;
             case "PK":
                 GlobalDataTemp.pkMatchType = PKMatchType.LocalPK;
-                JC.Unity.UI.CanvasUtils.PlusSortOrder(
+                JCUnityLib.CanvasUtils.PlusSortOrder(
                     gameObject,
                     GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/RoleSelectView")),
                     1

+ 1 - 1
Assets/BowArrow/Scripts/View/MeView.cs

@@ -33,7 +33,7 @@ public class MeView : MonoBehaviour, MenuBackInterface
         Destroy(this.gameObject);
     }
 
-    JC.CS.Throttler throttlerSave = new JC.CS.Throttler(2000);
+    JCUnityLib.Throttler throttlerSave = new JCUnityLib.Throttler(2000);
     public void Save() 
     {
         AudioMgr.ins.PlayBtn();

+ 2 - 2
Assets/BowArrow/Scripts/View/PKGameOptionView.cs

@@ -27,7 +27,7 @@ public class PKGameOptionView : MonoBehaviour, MenuBackInterface
         switch (target)
         {
             case "双人闯关":
-                JC.Unity.UI.CanvasUtils.PlusSortOrder(
+                JCUnityLib.CanvasUtils.PlusSortOrder(
                     gameObject,
                     GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/ChallengeOptionView")),
                     1
@@ -36,7 +36,7 @@ public class PKGameOptionView : MonoBehaviour, MenuBackInterface
             case "静止靶":
                 if (GlobalDataTemp.pkMatchType == PKMatchType.OnlinePK) {
                     GlobalDataTemp.matchGameType = 9;
-                    JC.Unity.UI.CanvasUtils.PlusSortOrder(
+                    JCUnityLib.CanvasUtils.PlusSortOrder(
                         gameObject,
                         GameObject.Instantiate(SceneResMgr.ins.GetPrefab("PKMatchView")),
                         1

+ 2 - 2
Assets/BowArrow/Scripts/View/PKGameSettleView.cs

@@ -42,7 +42,7 @@ public class PKGameSettleView : MonoBehaviour
                 gameRes = 1;
             }
             try { 
-                RankComp.ins.uploadPKGameRes(gameRes);
+                RankComp.Instance.uploadPKGameRes(gameRes);
             } catch (System.Exception e) { Debug.LogError(e.Message); }
         }
         if (GlobalData.pkMatchType == PKMatchType.OnlinePK) {
@@ -60,7 +60,7 @@ public class PKGameSettleView : MonoBehaviour
         SceneManager.LoadScene("Home", LoadSceneMode.Single);
     }
 
-    JC.CS.Throttler throttlerTryAgainOnline = new JC.CS.Throttler(3000);
+    JCUnityLib.Throttler throttlerTryAgainOnline = new JCUnityLib.Throttler(3000);
     public void OnClick_Again() {
         AudioMgr.ins.PlayBtn();
         if (GameAssistUI.ins) GameAssistUI.ins.recordPlayerRecordsWhenGameTryAgain();

+ 7 - 7
Assets/BowArrow/Scripts/View/PKMatchingView.cs

@@ -48,7 +48,7 @@ public class PKMatchingView : MonoBehaviour, MenuBackInterface
     public void OnDestroy() {
         if (ins == this) ins = null;
         PersistenHandler.ins?.menuBackCtr.views.Remove(this);
-        PKComp.ins.cancelRandomMatch();
+        PKComp.Instance.cancelRandomMatch();
     }
 
     void Start()
@@ -69,15 +69,15 @@ public class PKMatchingView : MonoBehaviour, MenuBackInterface
         }
         
         if (isFriendPKInviter) {
-            PKComp.ins.inviteFriendGamePK(targetInvitePlayerID, viewUUID);
+            PKComp.Instance.inviteFriendGamePK(targetInvitePlayerID, viewUUID);
         } else if (isFriendPKInvitee) {
-            PKComp.ins.acceptFriendGamePK(targetJoinRoomKey);
+            PKComp.Instance.acceptFriendGamePK(targetJoinRoomKey);
         } else if (isTryAgainInviter) {
-            PKComp.ins.inviteOtherTryAgainGamePK(viewUUID);
+            PKComp.Instance.inviteOtherTryAgainGamePK(viewUUID);
         } else if (isTryAgainInvitee) {
-            PKComp.ins.acceptOtherTryAgainGamePK(targetJoinTryAgainRoomKey);
+            PKComp.Instance.acceptOtherTryAgainGamePK(targetJoinTryAgainRoomKey);
         } else {
-            PKComp.ins.randomMatch();
+            PKComp.Instance.randomMatch();
         }
     }
 
@@ -94,7 +94,7 @@ public class PKMatchingView : MonoBehaviour, MenuBackInterface
         RenderTip(TextAutoLanguage2.GetTextByKey("pk-match_match-success"));
         HideBtnBack();
         PauseWaitingTime();
-        JC.Unity.CoroutineStarter.Start(LoadSceneOnEnterGame());
+        JCUnityLib.CoroutineStarter.Start(LoadSceneOnEnterGame());
     }
 
     IEnumerator LoadSceneOnEnterGame() {

+ 1 - 1
Assets/BowArrow/Scripts/View/RoleSelectView.cs

@@ -72,7 +72,7 @@ public class RoleSelectView : MonoBehaviour, MenuBackInterface
 
     public void StartGame() {
         AudioMgr.ins.PlayBtn();
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(
+        JCUnityLib.CanvasUtils.PlusSortOrder(
             gameObject,
             GameObject.Instantiate(SceneResMgr.ins.GetPrefab("PKGameOptionView")),
             1

+ 4 - 4
Assets/BowArrow/Scripts/View/SetUpView1.cs

@@ -31,13 +31,13 @@ public class SetUpView1 : MonoBehaviour, MenuBackInterface
     public void GoToGameSetupView() {
         AudioMgr.ins.PlayBtn();
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/SetUpView"));
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+        JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
     }
 
     public void GoToGameCourse() {
         AudioMgr.ins.PlayBtn();
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/CourseView"));
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+        JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
     }
 
     public void AboutUs() {
@@ -48,14 +48,14 @@ public class SetUpView1 : MonoBehaviour, MenuBackInterface
     public void GoToUserAgreement() {
         AudioMgr.ins.PlayBtn();
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+        JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
         o.GetComponent<AgreementView>().EnterUserAgreement();
     }
 
     public void GoToPrivacyAgreement() {
         AudioMgr.ins.PlayBtn();
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+        JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
         o.GetComponent<AgreementView>().EnterPrivacyAgreement();
     }
 

+ 4 - 4
Assets/BowArrow/Scripts/View/TopBarView.cs

@@ -105,7 +105,7 @@ public class TopBarView : MonoBehaviour
     public void GoToSetup() {
         AudioMgr.ins.PlayBtn();
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/SetUpView1"), Vector3.zero, new Quaternion());
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+        JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
     }
 
     public void GoToShop()
@@ -113,7 +113,7 @@ public class TopBarView : MonoBehaviour
         AudioMgr.ins.PlayBtn();
         if (ShopView.ins) return;
         GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/ShopView"));
-        JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+        JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
     }
 
     public void GoToLebo()
@@ -121,11 +121,11 @@ public class TopBarView : MonoBehaviour
         AudioMgr.ins.PlayBtn();
         if (ScreenProjectionView.ins) {
             GameObject o = ScreenProjectionView.ins.gameObject;
-            JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+            JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
             o.SetActive(true);
         } else {
             GameObject o = GameObject.Instantiate(SceneResMgr.ins.GetPrefab("ScreenProjectionView"));
-            JC.Unity.UI.CanvasUtils.PlusSortOrder(gameObject, o, 1);
+            JCUnityLib.CanvasUtils.PlusSortOrder(gameObject, o, 1);
         }
     }
 }

+ 2 - 3
Assets/JC/JCEngine.cs

@@ -4,7 +4,6 @@ using System.Collections.Generic;
 using BestHTTP.WebSocket;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
-using JC.Unity;
 using UnityEngine;
 
 namespace JCEngineCore {
@@ -149,12 +148,12 @@ namespace JCEngineCore {
             } catch (Exception) {}
             this.tempEntity.loaded = true;
             if (heartBeatCoroutine == null) {
-                heartBeatCoroutine = CoroutineStarter.Start(doHeartBeat());
+                heartBeatCoroutine = JCUnityLib.CoroutineStarter.Start(doHeartBeat());
             }
         }
         public void destroyTempEntity() {
             if (heartBeatCoroutine != null) {
-                CoroutineStarter.Stop(heartBeatCoroutine);
+                JCUnityLib.CoroutineStarter.Stop(heartBeatCoroutine);
                 heartBeatCoroutine = null;
             }
             if (this.tempEntity.isValid) {

+ 0 - 161
Assets/JC/JCLib.cs

@@ -1,161 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.EventSystems;
-
-namespace JC.CS 
-{
-    public class Utility
-    {
-        public static long GetTimestamp()
-        {
-            TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1);
-            return (long)ts.TotalMilliseconds;
-        }
-    }
-    public class CountLocker
-    {
-        int count = 0;
-        HashSet<object> objects = new HashSet<object>();
-        public void Lock()
-        {
-            count++;
-        } 
-        public void Lock(object obj) 
-        {
-            objects.Add(obj);
-        }
-        public void Unlock()
-        {
-            count--;
-            if (count < 0) count = 0;
-        }
-        public void Unlock(object obj) 
-        {
-            objects.Remove(obj);
-        }
-        public bool IsLocked()
-        {
-            return count > 0 || objects.Count > 0;
-        }
-        public bool IsReleased()
-        {
-            return !IsLocked();
-        }
-        public void Clear()
-        {
-            count = 0;
-            objects.Clear();
-        }
-    }
-    //节流器
-    public class Throttler {
-        long lastPassTime = -1;
-        long limitTime;
-        public Throttler(long limitTime) {
-            this.limitTime = limitTime;
-        }
-        public bool CanPass() {
-            long curTime = Utility.GetTimestamp();
-            if (lastPassTime < 0 || curTime - lastPassTime > limitTime) {
-                lastPassTime = curTime;
-                return true;
-            }
-            return false;
-        }
-    }
-}
-namespace JC.Unity
-{
-    public class AppRestartUtil {
-        public void Restart()
-        {
-            if (Application.platform != RuntimePlatform.Android) return;
-
-            using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
-            {
-                const int kIntent_FLAG_ACTIVITY_CLEAR_TASK = 0x00008000;
-                const int kIntent_FLAG_ACTIVITY_NEW_TASK = 0x10000000;
-
-                var currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
-                var pm = currentActivity.Call<AndroidJavaObject>("getPackageManager");
-                var intent = pm.Call<AndroidJavaObject>("getLaunchIntentForPackage", Application.identifier);
-
-                intent.Call<AndroidJavaObject>("setFlags", kIntent_FLAG_ACTIVITY_NEW_TASK | kIntent_FLAG_ACTIVITY_CLEAR_TASK);
-                currentActivity.Call("startActivity", intent);
-                currentActivity.Call("finish");
-                var process = new AndroidJavaClass("android.os.Process");
-                int pid = process.CallStatic<int>("myPid");
-                process.CallStatic("killProcess", pid);
-            }
-        }
-    }
-    public class TouchChecker
-    {   
-        bool hasTouch;
-        int touchID;
-        bool isTouchOnUI;
-        public Action<Touch, bool> onBegan;
-        public Action<Touch, bool> onMoved;
-        public Action<Touch, bool> onEnded;
-        public void Update()
-        {
-            if (Input.touchCount > 0) 
-            {
-                if (!hasTouch) 
-                {
-                    Touch touch = Input.GetTouch(0);
-                    if (touch.phase == TouchPhase.Began) 
-                    {
-                        hasTouch = true;
-                        touchID = touch.fingerId;
-                    }
-                }
-                if (hasTouch) {
-                    Touch touch = default;
-                    bool hasFindTouch = false;
-                    foreach (Touch t in Input.touches)
-                    {
-                        if (t.fingerId == touchID) 
-                        {
-                            touch = t;
-                            hasFindTouch = true;
-                            break;
-                        }
-                    }
-                    if (!hasFindTouch) 
-                    {
-                        hasTouch = false;
-                        return;
-                    }
-                    bool isOverUI = EventSystem.current.IsPointerOverGameObject(touchID);
-                    if (touch.phase == TouchPhase.Began) 
-                    {
-                        isTouchOnUI = isOverUI;
-                        onBegan?.Invoke(touch, isTouchOnUI);
-                    }
-                    else if (touch.phase == TouchPhase.Moved) 
-                    {
-                        isTouchOnUI = isOverUI;
-                        onMoved?.Invoke(touch, isTouchOnUI);
-                    }
-                    else if (touch.phase == TouchPhase.Stationary) 
-                    {
-
-                    }
-                    else if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled) 
-                    {
-                        hasTouch = false;
-                        //UnityBug,Ended阶段isOverUI总是返回false,因此通过新增变量touchOnUI来辅助识别触点是否在UI上
-                        onEnded?.Invoke(touch, isTouchOnUI);
-                    }
-                }
-            } 
-            else 
-            {
-                hasTouch = false;
-            }
-        }
-    }
-}

+ 0 - 11
Assets/JC/JCLib.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e52daed5b953b7840aebd78f7bd7052b
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

BIN
Assets/JC/JCUnityLib.dll


+ 33 - 0
Assets/JC/JCUnityLib.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 721aed4712129c94f8bc334e5d99fed4
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 18
Assets/JC/Singleton.cs

@@ -1,18 +0,0 @@
-// <summary>
-// 单例创建器
-// </summary>
-public class Singleton<T> where T : class, new()
-{
-    private static T _ins;
-    public static T ins
-    {
-        get
-        {
-            if (_ins == null)
-            {
-                _ins = new T();
-            }
-            return _ins;
-        }
-    }
-}

+ 0 - 11
Assets/JC/Singleton.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: af4178632ee4bd54c950eb19087391d5
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 39
Assets/JC/Untiy/CoroutineStarter.cs

@@ -1,39 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace JC.Unity {
-    // 协程启动器
-    public class CoroutineStarter : MonoBehaviour
-    {
-
-        private static CoroutineStarter _instance;
-
-        private static CoroutineStarter Instance {
-            get {
-                if ( _instance == null ) {
-                    GameObject obj = new GameObject("CoroutineStarter");
-                    obj.AddComponent<CoroutineStarter>();
-                }
-                return _instance;
-            }
-        }
-
-        void Awake() {
-            _instance = this;
-            DontDestroyOnLoad(gameObject);
-        }
-
-        /// <summary>
-        /// 开启协程
-        /// </summary>
-        /// <param name="enumerator"></param>
-        public static Coroutine Start(IEnumerator enumerator) {
-            return Instance.StartCoroutine(enumerator);
-        }
-
-        public static void Stop(Coroutine coroutine) {
-            Instance.StopCoroutine(coroutine);
-        }
-    }
-}

+ 0 - 11
Assets/JC/Untiy/CoroutineStarter.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 012c171b30b8c414c834a45cf12930e5
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 29
Assets/JC/Untiy/Debouncer.cs

@@ -1,29 +0,0 @@
-using System;
-using System.Collections;
-using UnityEngine;
-
-namespace JC.Unity {
-    //防抖器
-    public class Debouncer {
-        private Delegate dg;
-        private object[] args;
-        private float delayTime;
-        private Coroutine coroutine;
-        public Debouncer(Delegate dg, float delayTime) {
-            this.dg = dg;
-            this.delayTime = delayTime;
-        }
-        public void Invoke(params object[] args) {
-            if (coroutine != null) {
-                CoroutineStarter.Stop(coroutine);
-                coroutine = null;
-            }
-            this.args = args;
-            CoroutineStarter.Start(Execute());
-        }
-        private IEnumerator Execute() {
-            yield return new WaitForSecondsRealtime(delayTime);
-            dg?.Method?.Invoke(dg.Target, args);
-        }
-    }
-}

+ 0 - 11
Assets/JC/Untiy/Debouncer.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: cfb13a64796f4144c9fc99ece43f8b8d
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 1 - 45
Assets/JC/Untiy/UI/BackgroundAdapter.cs

@@ -1,51 +1,7 @@
 using UnityEngine;
 using UnityEngine.UI;
 
-namespace JC.Unity.UI {
-    public class AdapterUtils
-    {
-        public static void MakeRectTransformFullScreen(MonoBehaviour mono) {
-            RectTransform rtf = mono.GetComponent<RectTransform>();
-            rtf.anchorMin = Vector2.zero;
-            rtf.anchorMax = new Vector2(1, 1);
-            rtf.offsetMin = Vector2.zero;
-            rtf.offsetMax = Vector2.zero;
-        }
-    }
-    public class RectTransformUtils
-    {   
-        public static Vector3 CanvasV3ToScreenV3(Vector3 vector3, RectTransform rectTransform) {
-            Vector2 canvasSize = rectTransform.GetComponentInParent<CanvasScaler>().GetComponent<RectTransform>().sizeDelta;
-            vector3.y *= Screen.height / canvasSize.y;
-            vector3.x *= Screen.width / canvasSize.x;
-            return vector3;
-        }
-        public static Vector3 ScreenV3ToCanvasV3(Vector3 vector3, RectTransform rectTransform) {
-            Vector2 canvasSize = rectTransform.GetComponentInParent<CanvasScaler>().GetComponent<RectTransform>().sizeDelta;
-            vector3.y *= canvasSize.y / Screen.height;
-            vector3.x *= canvasSize.x / Screen.width;
-            return vector3;
-        }
-        public static Vector3 GetPositionByPivot(RectTransform rectTransform, Vector2 pivot) {
-            Vector2 sizeInScreen = CanvasV3ToScreenV3(rectTransform.rect.size, rectTransform);
-            Vector2 deltaPivot = pivot - rectTransform.pivot;
-            Vector3 deltaPos = sizeInScreen * deltaPivot;
-            return rectTransform.position + deltaPos;
-        }
-        public static void SetRectTransformSize(RectTransform trans, Vector2 newSize)
-        {
-            Vector2 oldSize = trans.rect.size;
-            Vector2 deltaSize = newSize - oldSize;
-            trans.offsetMin = trans.offsetMin - new Vector2(deltaSize.x * trans.pivot.x, deltaSize.y * trans.pivot.y);
-            trans.offsetMax = trans.offsetMax + new Vector2(deltaSize.x * (1f - trans.pivot.x), deltaSize.y * (1f - trans.pivot.y));
-        }
-    }   
-    public class CanvasUtils
-    {
-        public static void PlusSortOrder(GameObject src, GameObject des, int plusValue) {
-            des.GetComponent<Canvas>().sortingOrder = src.GetComponent<Canvas>().sortingOrder + plusValue;
-        }
-    }
+namespace JC.Unity.UI { 
     [ExecuteAlways]
     public class BackgroundAdapter : MonoBehaviour
     {