GameScripts

GameScripts
This commit is contained in:
ALEXTANG
2023-04-11 19:58:38 +08:00
parent 4e2b3756c9
commit 6e0785623d
25 changed files with 458 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
namespace GameBase
{
public class BaseClsTemplate<T>
{
protected static T Imp;
/// <summary>
/// Unity工程注册处理函数。
/// </summary>
/// <param name="imp">实现类。</param>
public static void RegisterImp(T imp)
{
Imp = imp;
}
}
}

View File

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

View File

@@ -0,0 +1,16 @@
{
"name": "GameBase",
"rootNamespace": "GameBase",
"references": [
"GUID:aa06d4cc755c979489c256c1bcca1dfb"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 08c3762f54316454ca6b6fbcb22b40e5
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
/// <summary>
/// 定义通用的逻辑接口,统一生命期调用
/// </summary>
public interface ILogicSys
{
/// <summary>
/// 初始化接口
/// </summary>
/// <returns></returns>
bool OnInit();
/// <summary>
/// 销毁系统
/// </summary>
void OnDestroy();
/// <summary>
/// 初始化后,第一帧统一调用
/// </summary>
void OnStart();
/// <summary>
/// 更新接口
/// </summary>
/// <returns></returns>
void OnUpdate();
/// <summary>
/// 渲染后调用
/// </summary>
void OnLateUpdate();
/// <summary>
/// 物理帧更新
/// </summary>
void OnFixedUpdate();
/// <summary>
/// 清理数据接口,切换账号/角色时调用
/// </summary>
void OnRoleLogout();
/// <summary>
/// OnDrawGizmos
/// </summary>
void OnDrawGizmos();
/// <summary>
/// 暂停游戏
/// </summary>
/// <param name="pause"></param>
void OnApplicationPause(bool pause);
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 63ff6535a43f41d7ac793b8a153a37b6
timeCreated: 1681213932

View File

@@ -0,0 +1,23 @@
using TEngine;
namespace GameBase
{
public class Singleton<T> where T:new()
{
private static T _instance;
public static T Instance
{
get
{
if (null == _instance)
{
_instance = new T();
Log.Assert(_instance != null);
}
return _instance;
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b68a449df312429cbb27873984ec238e
timeCreated: 1681214042