提交
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28085669128450d49829ad9c09bdb069
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class App
|
||||
{
|
||||
private static SApplication _sCurrSApplication = null;
|
||||
|
||||
public static void InitApplication(SApplication sApplication)
|
||||
{
|
||||
_sCurrSApplication = sApplication;
|
||||
_sCurrSApplication.Init();
|
||||
_sCurrSApplication.Enable();
|
||||
}
|
||||
|
||||
private static float LoadingProgressDelayTime = 0f;
|
||||
|
||||
public static void DisplayLoadingUI()
|
||||
{
|
||||
if (PlayerPrefs.GetInt("is_gift") == 1)
|
||||
{
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.UI_DisplayLoadingUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LoginAUI_Open);
|
||||
}
|
||||
}
|
||||
|
||||
public static void HideLoadingUI(bool isDelay = false)
|
||||
{
|
||||
if (!isDelay)
|
||||
{
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.UI_HideLoadingUI);
|
||||
return;
|
||||
}
|
||||
|
||||
TimerHelper.mEasy.AddTimer(0.5f, () => { AppDispatcher.Instance.Dispatch(AppMsg.UI_HideLoadingUI); });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58141605cb271ab488578de8509d91e7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f45f78800937eda4280b97dc62745da6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class AsyncDealData
|
||||
{
|
||||
public delegate void DealMethod();
|
||||
|
||||
|
||||
private float _currentTime;
|
||||
|
||||
|
||||
public float DelayTime = 1f;
|
||||
|
||||
|
||||
public DealMethod dealMethod;
|
||||
|
||||
|
||||
public int RepeatCount = 1;
|
||||
|
||||
|
||||
public bool IsComplete => RepeatCount == 0;
|
||||
|
||||
|
||||
public void PassTime(float time)
|
||||
{
|
||||
_currentTime += time;
|
||||
if (!(_currentTime >= DelayTime))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_currentTime -= DelayTime;
|
||||
Run();
|
||||
}
|
||||
|
||||
|
||||
private void Run()
|
||||
{
|
||||
if (RepeatCount == -1)
|
||||
{
|
||||
dealMethod?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RepeatCount > 0)
|
||||
{
|
||||
dealMethod?.Invoke();
|
||||
RepeatCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e51ff91679a44d1b1efe3438d508e74
|
||||
timeCreated: 1682577036
|
||||
@@ -0,0 +1,92 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
internal class AsyncKitUnityBehaviour : SingletonUnity<AsyncKitUnityBehaviour>
|
||||
{
|
||||
private readonly Dictionary<string, AsyncDealData> _asyncDataDict = new Dictionary<string, AsyncDealData>();
|
||||
|
||||
|
||||
private readonly Dictionary<string, AsyncDealData> _updateActionDict = new Dictionary<string, AsyncDealData>();
|
||||
|
||||
private readonly List<string> _keyClean = new List<string>();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
foreach (var temp in _asyncDataDict.Values)
|
||||
{
|
||||
temp.PassTime(Time.deltaTime);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var temp in _updateActionDict.Values)
|
||||
{
|
||||
temp?.dealMethod?.Invoke();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ClearFinished();
|
||||
|
||||
|
||||
ClearUpdateActionFinished();
|
||||
}
|
||||
|
||||
|
||||
private void ClearFinished()
|
||||
{
|
||||
_keyClean.Clear();
|
||||
foreach (var dealData in _asyncDataDict)
|
||||
{
|
||||
if (dealData.Value.IsComplete)
|
||||
{
|
||||
_keyClean.Add(dealData.Key);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var key in _keyClean)
|
||||
{
|
||||
_asyncDataDict.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void AddAsyncData(string key, AsyncDealData asyncDealData)
|
||||
{
|
||||
RemoveAsyncData(key);
|
||||
_asyncDataDict.Add(key, asyncDealData);
|
||||
}
|
||||
|
||||
|
||||
public void RemoveAsyncData(string key)
|
||||
{
|
||||
if (_asyncDataDict.ContainsKey(key))
|
||||
{
|
||||
_asyncDataDict.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearUpdateActionFinished()
|
||||
{
|
||||
_keyClean.Clear();
|
||||
foreach (var dealData in _updateActionDict)
|
||||
{
|
||||
if (dealData.Value.IsComplete)
|
||||
{
|
||||
_keyClean.Add(dealData.Key);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var key in _keyClean)
|
||||
{
|
||||
_updateActionDict.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 984d18c5a4974e729d72276896426930
|
||||
timeCreated: 1682577036
|
||||
@@ -0,0 +1,61 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public static class CrazyAsyKit
|
||||
{
|
||||
private static AsyncKitUnityBehaviour sAsyncKitUnityBehaviour;
|
||||
|
||||
|
||||
private static readonly object SynClock = new object();
|
||||
|
||||
private static AsyncKitUnityBehaviour mAsyncKitUnityBehaviour
|
||||
{
|
||||
get
|
||||
{
|
||||
if (sAsyncKitUnityBehaviour != null)
|
||||
{
|
||||
return sAsyncKitUnityBehaviour;
|
||||
}
|
||||
|
||||
lock (SynClock)
|
||||
{
|
||||
if (sAsyncKitUnityBehaviour != null)
|
||||
{
|
||||
return sAsyncKitUnityBehaviour;
|
||||
}
|
||||
|
||||
|
||||
sAsyncKitUnityBehaviour = AsyncKitUnityBehaviour.Instance;
|
||||
if (sAsyncKitUnityBehaviour != null)
|
||||
{
|
||||
sAsyncKitUnityBehaviour.name = "[ CrazyAsyKit ]";
|
||||
}
|
||||
}
|
||||
|
||||
return sAsyncKitUnityBehaviour;
|
||||
}
|
||||
}
|
||||
|
||||
public static Coroutine StartCoroutine(IEnumerator enumerator)
|
||||
{
|
||||
return mAsyncKitUnityBehaviour.StartCoroutine(enumerator);
|
||||
}
|
||||
|
||||
public static void StartAction(string key, AsyncDealData.DealMethod method, float delayTime, int repeat = 1)
|
||||
{
|
||||
var temp = new AsyncDealData { dealMethod = method, DelayTime = delayTime, RepeatCount = repeat };
|
||||
mAsyncKitUnityBehaviour.AddAsyncData(key, temp);
|
||||
}
|
||||
|
||||
public static void StopCoroutine(Coroutine enumerator)
|
||||
{
|
||||
mAsyncKitUnityBehaviour.StopCoroutine(enumerator);
|
||||
}
|
||||
public static void StopAction(string key)
|
||||
{
|
||||
mAsyncKitUnityBehaviour.RemoveAsyncData(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93122ca4429e463aba586a345558ed8e
|
||||
timeCreated: 1682577036
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public abstract class BaseScene
|
||||
{
|
||||
public abstract int SceneIdx { get; }
|
||||
|
||||
public void Enter()
|
||||
{
|
||||
App.DisplayLoadingUI();
|
||||
OnEnter();
|
||||
}
|
||||
|
||||
public void Leave()
|
||||
{
|
||||
OnLeave();
|
||||
}
|
||||
|
||||
public void SwitchSceneComplete(object param)
|
||||
{
|
||||
OnSwitchSceneComplete(param);
|
||||
}
|
||||
|
||||
protected abstract void OnEnter();
|
||||
protected abstract void OnLeave();
|
||||
protected abstract void OnSwitchSceneComplete(object param);
|
||||
|
||||
public abstract void Dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 36208f1ae07fbee498389575991236b5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public abstract class BaseSystem
|
||||
{
|
||||
public virtual void Init()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void InitLate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void LateUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void FixedUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db46851f313c4809855238569ed6cfac
|
||||
timeCreated: 1692256359
|
||||
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class CrazyZooBoot : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
OnLauncher();
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "bootstrap",
|
||||
payload = ""
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// PlayerPrefs.DeleteAll();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void OnLauncher()
|
||||
{
|
||||
AppObjConst.FrameGo = new GameObject($"{AppObjConst.FrameGoName}");
|
||||
AppObjConst.FrameGo.AddComponent<CrazyZooCore>();
|
||||
DontDestroyOnLoad(AppObjConst.FrameGo);
|
||||
App.InitApplication(SuperApplication.Instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 958cbcd088fb3bc4c826840c9648b64e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class CrazyZooCore : SingletonUnity<CrazyZooCore>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41b35f98275b2ce40ac58d230dba9d80
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ScrewsMaster;
|
||||
using Spine.Unity;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public class CreatSheepCard : MonoBehaviour
|
||||
{
|
||||
|
||||
public static CreatSheepCard instance;
|
||||
private List<Sprite> img_list;
|
||||
|
||||
public Camera orthoCamera; // 这个变量应该被设置为您想要调整大小的正交相机
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
orthoCamera = GameObject.Find("Camera1").GetComponent<Camera>();
|
||||
|
||||
orthoCamera.orthographicSize = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c892366728def834886c9f73f77e88f9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be8781ff9378e5345a9f6188e990a359
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7146600e94b62843b388e234c8ce824
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class AnimConst
|
||||
{
|
||||
public const float AnimFrameRate = 30;
|
||||
public const float SecondRateUnit = 1 / AnimFrameRate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db177b3a2887ce0498712919fed1ee4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class AppConst
|
||||
{
|
||||
#region Field
|
||||
|
||||
public static bool IsEnabledEngineLog = true;
|
||||
|
||||
public const LogType EnabledFilterLogType =
|
||||
LogType.Log | LogType.Warning | LogType.Error | LogType.Assert |
|
||||
LogType.Exception;
|
||||
|
||||
public const bool IsRunInBG = true;
|
||||
public const int SleepTimeoutMode = SleepTimeout.NeverSleep;
|
||||
public const int AntiAliasing = 0;
|
||||
public const int HighFrameRate = 120;
|
||||
public const int LowFrameRate = 60;
|
||||
public const float HDHighViewScale = 1f;
|
||||
public const float HDLowViewScale = 0.9f;
|
||||
public const float PixelsPerUnit = 100f;
|
||||
|
||||
public static Vector2Int StandardResolution = new Vector2Int(1080, 1920);
|
||||
|
||||
public static Vector2Int UIResolution = new Vector2Int(1080, 1920);
|
||||
|
||||
public static bool UseInternalSetting = true;
|
||||
|
||||
public static bool IsMultiLangue = true;
|
||||
|
||||
public static string CurrMultiLangue = "en";
|
||||
|
||||
public static string DefaultLangue = "en";
|
||||
|
||||
public static string InternalLangue = "en";
|
||||
|
||||
public static List<string> CtrlDisableList = new List<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
public static bool isPt()
|
||||
{
|
||||
if (CurrMultiLangue == "pt") return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e2daa6b68221ec4f8e0b643de38afd1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class AppObjConst
|
||||
{
|
||||
public const string FrameGoName = "[ Jarvis ]";
|
||||
public static GameObject FrameGo;
|
||||
|
||||
public const string LauncherGoName = "[Launcher]";
|
||||
|
||||
public const string EngineEventSystemGoName = "[EngineEventSystem]";
|
||||
public static GameObject EngineEventSystemGo;
|
||||
|
||||
public const string ApplicationGoName = "[ Application ]";
|
||||
public static GameObject ApplicationGo;
|
||||
|
||||
public const string EngineSingletonGoName = "[EngineSingleton]";
|
||||
public static GameObject EngineSingletonGo;
|
||||
public const string MonoManagerGoName = "[MonoManager]";
|
||||
public static GameObject MonoManagerGo;
|
||||
public const string DispatcherGoName = "[Dispatcher]";
|
||||
public static GameObject DispatcherGo;
|
||||
public const string LoaderGoName = "[Loader]";
|
||||
public static GameObject LoaderGo;
|
||||
|
||||
public const string CameraGoName = "[Camera]";
|
||||
public static GameObject CameraGo;
|
||||
|
||||
public const string UIGoName = "[UI]";
|
||||
public static GameObject UIGo;
|
||||
public const string UICacheGoName = "[UICache]";
|
||||
public static GameObject UICacheGo;
|
||||
|
||||
public const string DOTweenGoName = "[DOTween]";
|
||||
public const string SuperInvokeGoName = "[SuperInvoke]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce9826ccd786f9e46a1fb245b9fe4a04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class AudioConst
|
||||
{
|
||||
public const string UIButtonDefault = "ui_ButtonDefault";
|
||||
public const string DailyBonusCollect = "dailyBonus_collect";
|
||||
public const string CoinFly = "coinfly";
|
||||
public const string MainBg = "hall_bgm";
|
||||
public const string PlayingBg = "twist_gamebgm";
|
||||
public const string dissolve = "dissolve";
|
||||
public const string fellshort = "fellshort";
|
||||
public const string Victoriously = "Victoriously";
|
||||
public const string MakeupDone = "makupdone";
|
||||
public const string Defeat = "Defeat";
|
||||
public const string Victory = "Victory";
|
||||
public const string Bonus = "Bonus";
|
||||
public const string SwitchBox = "SwitchBox";
|
||||
public const string FlyToCacheKong = "FlyToCacheKong";
|
||||
public const string PlayPrizeWheelAnim = "PlayPrizeWheelAnim";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbb65f81bcb66ff48abc55f1c1150765
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class CameraConst
|
||||
{
|
||||
public const int MainDepth = 0;
|
||||
public const int UICameraDepth = 10;
|
||||
|
||||
public const int MainCameraPosValue = 100;
|
||||
public const int MainCameraZPos = 0;
|
||||
public const int UICameraPosValue = 10000;
|
||||
|
||||
public static Vector3 MainCameraPos = new Vector3(MainCameraPosValue, MainCameraPosValue, MainCameraZPos);
|
||||
public static Vector3 UICameraPos = new Vector3(UICameraPosValue, UICameraPosValue, MainCameraZPos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2555d38a702f494ca13aaf957846be9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class LayerMaskConst
|
||||
{
|
||||
public const string Default_Name = "Default";
|
||||
public const string UI_Name = "UI";
|
||||
|
||||
public readonly static int Default = LayerMask.NameToLayer(Default_Name);
|
||||
public readonly static int UI = LayerMask.NameToLayer(UI_Name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f53446f031c27d4eae9f0ff7d3e4565
|
||||
timeCreated: 1530670154
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class PrefsConst
|
||||
{
|
||||
public const bool BoolDefault = false;
|
||||
public const int IntDefault = 0;
|
||||
public const int IntTrue = 1;
|
||||
public const int IntFalse = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cb940cabfde0ad4c8a849ca893d686c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class PrefsKeyConst
|
||||
{
|
||||
public const string Application_isHDMode = "Application_isHDMode";
|
||||
public const string Application_isHFRMode = "Application_isHFRMode";
|
||||
public const string UIMgr_switchLanguage = "UIMgr_switchLanguage";
|
||||
public const string AudioMgr_isOpenBGM = "AudioMgr_isOpenBGM";
|
||||
public const string AudioMgr_isOpenEffect = "AudioMgr_isOpenEffect";
|
||||
public const string App_isNewInstall = "App_isNewInstall";
|
||||
public const string JarvisToken = "JarvisToken";
|
||||
public const string C_ThroughMaxToday = "C_ThroughMaxToday";
|
||||
public const string C_ThroughPop = "C_ThroughPop";
|
||||
public const string C_ThroughOnline = "C_ThroughOnline";
|
||||
|
||||
public const string C_ThroughHide = "C_ThroughHide";
|
||||
|
||||
public const string C_ThroughFly = "C_ThroughFly";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bec1a938462feda4eba6b162b9a387e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class ScreenConst
|
||||
{
|
||||
public static Vector2 StandardResolution = new(AppConst.StandardResolution.x, AppConst.StandardResolution.y);
|
||||
public static float StandardWidth => AppConst.StandardResolution.x;
|
||||
public static float StandardHeight => AppConst.StandardResolution.y;
|
||||
public static Vector2 RawResolution = new(Screen.width, Screen.height);
|
||||
public static Vector2 CurrResolution = new(Screen.width, Screen.height);
|
||||
public static float OrthographicSize_1280H = StandardHeight / 2 / AppConst.PixelsPerUnit;
|
||||
public static float StandardAspectRatio = StandardHeight / StandardWidth;
|
||||
public static float CurrAspectRatio = (float)Screen.height / Screen.width;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76e7d3de03bd12a44b19e935ea71697a
|
||||
timeCreated: 1534935298
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class UILayerConst
|
||||
{
|
||||
public const string Background = "Background";
|
||||
public const string Bottom = "Bottom";
|
||||
|
||||
public const string Normal = "Normal";
|
||||
public const string Top = "Top";
|
||||
|
||||
public const string FullScreen = "FullScreen";
|
||||
public const string Popup = "Popup";
|
||||
|
||||
public const string Highest = "Highest";
|
||||
public const string Animation = "Animation";
|
||||
public const string Tips = "Tips";
|
||||
|
||||
public const string Loading = "Loading";
|
||||
public const string System = "System";
|
||||
public const string NetworkError = "NetworkError";
|
||||
|
||||
public static readonly string[] AllUILayer = {
|
||||
Background,
|
||||
Bottom,
|
||||
|
||||
Normal,
|
||||
Top,
|
||||
|
||||
FullScreen,
|
||||
Popup,
|
||||
|
||||
Highest,
|
||||
Animation,
|
||||
Tips,
|
||||
|
||||
Loading,
|
||||
System,
|
||||
NetworkError
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1cfef99d74aac943a6872498ec8fb4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class VectorConst
|
||||
{
|
||||
public static Vector3 One = Vector3.one;
|
||||
public static Vector3 PPUOne = One * AppConst.PixelsPerUnit;
|
||||
public static Vector3 Half = new(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae89e346ddf1a584382a1deb4b78193a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class YieldConst
|
||||
{
|
||||
public const float Time10ms = 0.01f;
|
||||
public const float Time100ms = 0.1f;
|
||||
|
||||
public static WaitForEndOfFrame WaitForEndOfFrame = new WaitForEndOfFrame();
|
||||
public static WaitForSeconds WaitFor100ms = new WaitForSeconds(Time100ms);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6248774d8e1b69d46a89ad1ea46081ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f14f42c47ff29474bb4170a49c3bc8c1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static partial class CtrlMsg
|
||||
{
|
||||
public const string NAME = "CtrlMsg";
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
public static readonly uint Login_Succeed = ++Cursor_BASE;
|
||||
public static readonly uint Game_StartReady = ++Cursor_BASE;
|
||||
public static readonly uint Game_Start = ++Cursor_BASE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19bfc133c0819ad4486cceca51c8a2e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static partial class GameMsg
|
||||
{
|
||||
public const string NAME = "GameMsg";
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d7b577419d940f468e1a95a9afb1dd9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static partial class UICtrlMsg
|
||||
{
|
||||
public const string NAME = "UICtrlMsg";
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb50862938136744db6a10a950ab4a27
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05068ae3f93705047a7ad62030047667
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class ChangeValue<T>
|
||||
{
|
||||
public T oldValue;
|
||||
public T newValue;
|
||||
|
||||
public ChangeValue()
|
||||
{
|
||||
}
|
||||
|
||||
public ChangeValue(T oldValue, T newValue)
|
||||
{
|
||||
this.oldValue = oldValue;
|
||||
this.newValue = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c53b34a8fdfa77143b24d0660057d5a7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb2dde3fe0fcf6c4cb36b2a465cb36d1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10e424129050f3a4ab3fdc991bf91318
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public abstract class BaseDispatcher<T, Msg, Param> : IDisposable where T : class, new() where Param : class
|
||||
{
|
||||
private static T m_instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_instance == null)
|
||||
{
|
||||
m_instance = new T();
|
||||
}
|
||||
|
||||
return m_instance;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgPriorityDict = new();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgDict = new();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgFinallyDict = new();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgOnceDict = new();
|
||||
|
||||
public void AddListener(Msg msgId, Action<Param> listener)
|
||||
{
|
||||
if (m_msgDict.TryGetValue(msgId, out var value))
|
||||
{
|
||||
value.Add(listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = ListPool<Action<Param>>.Get();
|
||||
list.Add(listener);
|
||||
m_msgDict.Add(msgId, list);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddOnceListener(Msg msgId, Action<Param> listener)
|
||||
{
|
||||
if (m_msgOnceDict.TryGetValue(msgId, out var value))
|
||||
{
|
||||
value.Add(listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = ListPool<Action<Param>>.Get();
|
||||
list.Add(listener);
|
||||
m_msgOnceDict.Add(msgId, list);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveListener(Msg msgId, Action<Param> listener)
|
||||
{
|
||||
if (m_msgDict.TryGetValue(msgId, out var list))
|
||||
{
|
||||
if (list.Contains(listener))
|
||||
{
|
||||
list.Remove(listener);
|
||||
if (list.Count == 0)
|
||||
{
|
||||
ListPool<Action<Param>>.Release(list);
|
||||
m_msgDict.Remove(msgId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispatch(Msg msgId, Param param = null)
|
||||
{
|
||||
InvokeMethods(m_msgPriorityDict, msgId, param);
|
||||
InvokeMethods(m_msgDict, msgId, param);
|
||||
InvokeMethods(m_msgFinallyDict, msgId, param);
|
||||
InvokeMethods(m_msgOnceDict, msgId, param);
|
||||
|
||||
if (m_msgOnceDict.ContainsKey(msgId))
|
||||
{
|
||||
ListPool<Action<Param>>.Release(m_msgOnceDict[msgId]);
|
||||
m_msgOnceDict.Remove(msgId);
|
||||
}
|
||||
}
|
||||
|
||||
private void InvokeMethods(Dictionary<Msg, List<Action<Param>>> msgDict, Msg msgId, Param param)
|
||||
{
|
||||
if (!msgDict.ContainsKey(msgId)) return;
|
||||
|
||||
var rawList = msgDict[msgId];
|
||||
int funcCount = rawList.Count;
|
||||
if (funcCount == 1)
|
||||
{
|
||||
Action<Param> onEvent = rawList[0];
|
||||
onEvent(param);
|
||||
return;
|
||||
}
|
||||
|
||||
var invokeFuncs = ListPool<Action<Param>>.Get();
|
||||
invokeFuncs.AddRange(rawList);
|
||||
for (var i = 0; i < funcCount; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
var onEvent = invokeFuncs[i];
|
||||
onEvent(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
|
||||
ListPool<Action<Param>>.Release(invokeFuncs);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
m_instance = null;
|
||||
|
||||
m_msgPriorityDict.Clear();
|
||||
m_msgDict.Clear();
|
||||
m_msgFinallyDict.Clear();
|
||||
m_msgOnceDict.Clear();
|
||||
m_msgPriorityDict = null;
|
||||
m_msgDict = null;
|
||||
m_msgFinallyDict = null;
|
||||
m_msgOnceDict = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4b55125cefc9754888cccfc76bee4c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class BaseMainThreadDispatcher<T, Msg, Param> : SingletonUnity<T>
|
||||
where T : SingletonUnity<T>
|
||||
where Param : class
|
||||
{
|
||||
private class MainThreadMsgClass
|
||||
{
|
||||
public Msg currMsgId;
|
||||
public Param currParam;
|
||||
}
|
||||
|
||||
private Queue<MainThreadMsgClass> m_msgQueue = new Queue<MainThreadMsgClass>();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgPriorityDict = new Dictionary<Msg, List<Action<Param>>>();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgDict = new Dictionary<Msg, List<Action<Param>>>();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgOnceDict = new Dictionary<Msg, List<Action<Param>>>();
|
||||
|
||||
private object m_queueLock = new object();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (m_msgQueue.Count <= 0) return;
|
||||
|
||||
while (m_msgQueue.Count > 0)
|
||||
{
|
||||
MainThreadMsgClass msg;
|
||||
lock (m_queueLock)
|
||||
{
|
||||
msg = m_msgQueue.Dequeue();
|
||||
}
|
||||
|
||||
AutoDispatch(msg.currMsgId, msg.currParam);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispatch(Msg msgId, Param param = null)
|
||||
{
|
||||
if (!m_msgPriorityDict.ContainsKey(msgId)
|
||||
&& !m_msgDict.ContainsKey(msgId)
|
||||
&& !m_msgOnceDict.ContainsKey(msgId))
|
||||
return;
|
||||
|
||||
MainThreadMsgClass msg = new MainThreadMsgClass
|
||||
{
|
||||
currMsgId = msgId,
|
||||
currParam = param,
|
||||
};
|
||||
lock (m_queueLock)
|
||||
{
|
||||
m_msgQueue.Enqueue(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoDispatch(Msg msgId, Param param)
|
||||
{
|
||||
InvokeMethods(m_msgPriorityDict, msgId, param);
|
||||
InvokeMethods(m_msgDict, msgId, param);
|
||||
InvokeMethods(m_msgOnceDict, msgId, param);
|
||||
|
||||
if (m_msgOnceDict.ContainsKey(msgId))
|
||||
{
|
||||
ListPool<Action<Param>>.Release(m_msgOnceDict[msgId]);
|
||||
m_msgOnceDict.Remove(msgId);
|
||||
}
|
||||
}
|
||||
|
||||
private void InvokeMethods(Dictionary<Msg, List<Action<Param>>> msgDict, Msg msgId, Param param)
|
||||
{
|
||||
if (!msgDict.ContainsKey(msgId)) return;
|
||||
|
||||
List<Action<Param>> rawList = msgDict[msgId];
|
||||
int funcCount = rawList.Count;
|
||||
if (funcCount == 1)
|
||||
{
|
||||
Action<Param> onEvent = rawList[0];
|
||||
onEvent(param);
|
||||
return;
|
||||
}
|
||||
|
||||
List<Action<Param>> invokeFuncs = ListPool<Action<Param>>.Get();
|
||||
invokeFuncs.AddRange(rawList);
|
||||
for (int i = 0; i < funcCount; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Action<Param> onEvent = invokeFuncs[i];
|
||||
onEvent(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
|
||||
ListPool<Action<Param>>.Release(invokeFuncs);
|
||||
}
|
||||
|
||||
protected override string ParentRootName
|
||||
{
|
||||
get { return AppObjConst.DispatcherGoName; }
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
m_msgPriorityDict.Clear();
|
||||
m_msgDict.Clear();
|
||||
m_msgOnceDict.Clear();
|
||||
m_msgPriorityDict = null;
|
||||
m_msgDict = null;
|
||||
m_msgOnceDict = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e02321e1c5d556b4484a914fec6eafbd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7926ab78fe6049f3bff905262b9b4695
|
||||
timeCreated: 1682307945
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class AppDispatcher : BaseDispatcher<AppDispatcher, uint, object> { }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38ec268add4ac6743a27b7167bdcb36a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class CtrlDispatcher : BaseDispatcher<CtrlDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f627301519ad9ac43ba05e525564d3a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class DataDispatcher : BaseDispatcher<DataDispatcher, string, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 080dce14c0be15a448f7a6f1d316700f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class GameDispatcher : BaseDispatcher<GameDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab8a1624eafed174385147056385f287
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class MainThreadDispatcher : BaseMainThreadDispatcher<MainThreadDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc759fa7eaebc574da1d3990ca6acfa5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class ModelDispatcher : BaseDispatcher<ModelDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 730ba6382f4f49444a8219f08543f431
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class NetworkDispatcher : BaseDispatcher<NetworkDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81a02ff4d9ca458aa70fe26ab514bb99
|
||||
timeCreated: 1681977441
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class PreferencesDispatcher<T> : BaseDispatcher<PreferencesDispatcher<T>, string, ChangeValue<T>>
|
||||
{
|
||||
public ChangeValue<T> changeValue;
|
||||
|
||||
public PreferencesDispatcher()
|
||||
{
|
||||
changeValue = new ChangeValue<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9387267f575e6bb4ca279738a461ad61
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public class UICtrlDispatcher : BaseDispatcher<UICtrlDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1a26910085caa349b769e0be54a023a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29aecd4f55584cddae5eb19c86727362
|
||||
timeCreated: 1682308355
|
||||
@@ -0,0 +1,28 @@
|
||||
public static class AppMsg
|
||||
{
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
public static readonly uint App_Quit = ++Cursor_BASE;
|
||||
public static readonly uint App_Focus_False = ++Cursor_BASE;
|
||||
public static readonly uint App_Pause_True = ++Cursor_BASE;
|
||||
public static readonly uint App_GamePause = ++Cursor_BASE;
|
||||
public static readonly uint App_GameResume = ++Cursor_BASE;
|
||||
public static readonly uint App_SwitchLanguage = ++Cursor_BASE;
|
||||
public static readonly uint UI_DisplayLoadingUI = ++Cursor_BASE;
|
||||
public static readonly uint UI_HideLoadingUI = ++Cursor_BASE;
|
||||
public static readonly uint UI_LoadingInitAsset = ++Cursor_BASE;
|
||||
public static readonly uint AppManagerRegister = ++Cursor_BASE;
|
||||
public static readonly uint InitUIMgr = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIOpen = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIClose = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIDisplay = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIHide = ++Cursor_BASE;
|
||||
public static readonly uint KeyCode_Home = ++Cursor_BASE;
|
||||
public static readonly uint KeyCode_Escape = ++Cursor_BASE;
|
||||
public static readonly uint TimeScale_Change = ++Cursor_BASE;
|
||||
public static readonly uint WorldRaycast_EnableChange = ++Cursor_BASE;
|
||||
public static readonly uint App_Focus_True = ++Cursor_BASE;
|
||||
public static readonly uint LoginInit = ++Cursor_BASE;
|
||||
public static readonly uint Show_uid = ++Cursor_BASE;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b87eaa2cadb1da4f8dba83b0b9d3731
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
public static class MainThreadMsg
|
||||
{
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
public static readonly uint App_Focus_True = ++Cursor_BASE;
|
||||
public static readonly uint App_Pause_False = ++Cursor_BASE;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0061a4ff521ce154c8ca284f91d1cf8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using ScrewsMaster;
|
||||
|
||||
|
||||
public class ErrorLogger : MonoBehaviour
|
||||
{
|
||||
// 用于存储报错信息的列表
|
||||
private List<string> errorLogs = new List<string>();
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// 注册事件处理函数
|
||||
Application.logMessageReceived += HandleLog;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
// 注销事件处理函数
|
||||
Application.logMessageReceived -= HandleLog;
|
||||
}
|
||||
|
||||
// 事件处理函数
|
||||
void HandleLog(string logString, string stackTrace, LogType type)
|
||||
{
|
||||
// 只处理错误和异常类型的日志
|
||||
if (type == LogType.Error || type == LogType.Exception)
|
||||
{
|
||||
// 将报错信息和堆栈跟踪添加到列表中
|
||||
errorLogs.Add(logString);
|
||||
errorLogs.Add(stackTrace);
|
||||
|
||||
// 这里可以添加代码将报错信息发送给服务器
|
||||
SendErrorToServer(logString, stackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
// 如何将报错信息发送给服务器
|
||||
void SendErrorToServer(string error, string stackTrace)
|
||||
{
|
||||
// Debug.Log($"SendErrorToServer-----------error\n{error}");
|
||||
// Debug.Log($"SendErrorToServer-----------stackTrace\n{stackTrace}");
|
||||
// 这里填写将报错信息发送到服务器的代码
|
||||
GameHelper.SendErrorToServer(error, stackTrace);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a9adb6383d4d1846a5c1efee1e943ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5af2e719d8d8cd4891e2098b3dad9e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class StringExtend
|
||||
{
|
||||
public static double ToDouble(this string str)
|
||||
{
|
||||
double temp = 0d;
|
||||
double.TryParse(str, out temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static float ToFloat(this string str)
|
||||
{
|
||||
float temp = 0;
|
||||
float.TryParse(str, out temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static bool IsNullOrWhiteSpace(this string str)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79592f013fcf6dc439f2a2940770a250
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07cf9660c4614ccca70ef0f5889aae92
|
||||
timeCreated: 1682316629
|
||||
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public static class GameObjectExtend
|
||||
{
|
||||
public static void SetParent(this GameObject gameObject, GameObject parentGo, bool worldPositionStays = false)
|
||||
{
|
||||
if (parentGo)
|
||||
{
|
||||
gameObject.transform.SetParent(parentGo.transform, worldPositionStays);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetLayer(this GameObject gameObject, string layerName)
|
||||
{
|
||||
Transform[] transArr = gameObject.transform.GetComponentsInChildren<Transform>();
|
||||
for (int i = 0; i < transArr.Length; i++)
|
||||
{
|
||||
transArr[i].gameObject.layer = LayerMask.NameToLayer(layerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f33a4adea56c7dc41944ee83d4ef3f84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e61d44d2343c5f4589e13779ec5cb71
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
using Unity.Services.Core;
|
||||
using Unity.Services.Core.Environments;
|
||||
using UnityEngine;
|
||||
|
||||
public class InitializeUnityServices : MonoBehaviour
|
||||
{
|
||||
public string environment = "prime-script-405407";
|
||||
async void Start()
|
||||
{
|
||||
|
||||
Debug.Log($"Start environment: {environment}");
|
||||
|
||||
var options = new InitializationOptions().SetEnvironmentName(environment);
|
||||
await UnityServices.InitializeAsync(options);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b88f4352f192a34ca4217a9f96f870e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f9cd760110665a41a7b4c4a96ae85e0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45a53fe4413ebe44dbf670faf8651e3b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,114 @@
|
||||
namespace ScrewsMaster
|
||||
{
|
||||
public abstract class BaseCtrl
|
||||
{
|
||||
public string ctrlName;
|
||||
public bool isEnable = true;
|
||||
public bool IsNew { get; private set; }
|
||||
|
||||
protected ModuleManager moduleManager;
|
||||
|
||||
protected ModelDispatcher modelDispatcher;
|
||||
protected CtrlDispatcher ctrlDispatcher;
|
||||
protected UICtrlDispatcher uiCtrlDispatcher;
|
||||
protected DataDispatcher dataDispatcher;
|
||||
protected GameDispatcher gameDispatcher;
|
||||
|
||||
public void New()
|
||||
{
|
||||
if (!isEnable) return;
|
||||
|
||||
OnNew();
|
||||
IsNew = true;
|
||||
}
|
||||
|
||||
public virtual void Init()
|
||||
{
|
||||
if (!isEnable) return;
|
||||
|
||||
Assignment();
|
||||
AddListener();
|
||||
AddServerListener();
|
||||
OnInit();
|
||||
}
|
||||
|
||||
public virtual void StartUp()
|
||||
{
|
||||
if (!isEnable) return;
|
||||
|
||||
OnStartUp();
|
||||
}
|
||||
|
||||
public virtual void GameStart()
|
||||
{
|
||||
if (!isEnable) return;
|
||||
|
||||
OnGameStart();
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (!isEnable) return;
|
||||
|
||||
RemoveListener();
|
||||
RemoveServerListener();
|
||||
OnDispose();
|
||||
UnAssignment();
|
||||
IsNew = false;
|
||||
}
|
||||
|
||||
protected virtual void Assignment()
|
||||
{
|
||||
moduleManager = ModuleManager.Instance;
|
||||
|
||||
modelDispatcher = ModelDispatcher.Instance;
|
||||
ctrlDispatcher = CtrlDispatcher.Instance;
|
||||
uiCtrlDispatcher = UICtrlDispatcher.Instance;
|
||||
dataDispatcher = DataDispatcher.Instance;
|
||||
gameDispatcher = GameDispatcher.Instance;
|
||||
}
|
||||
|
||||
protected virtual void UnAssignment()
|
||||
{
|
||||
moduleManager = null;
|
||||
|
||||
modelDispatcher = null;
|
||||
ctrlDispatcher = null;
|
||||
uiCtrlDispatcher = null;
|
||||
dataDispatcher = null;
|
||||
gameDispatcher = null;
|
||||
}
|
||||
|
||||
protected virtual void OnNew()
|
||||
{
|
||||
}
|
||||
|
||||
protected abstract void OnInit();
|
||||
|
||||
protected virtual void OnStartUp()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void OnGameStart()
|
||||
{
|
||||
}
|
||||
|
||||
protected abstract void OnDispose();
|
||||
|
||||
protected virtual void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void AddServerListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void RemoveServerListener()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user