Files
TEngine/Books/2-框架概览.md
ALEXTANG 4988c99d31 [+] Books
[+] Books
2023-07-10 12:51:13 +08:00

68 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# TEngine
## TEngine-Runtime
### AOT内核基于Gameframework,最简化以及商业化适配。
![image](src/2-1.png)
## AOT游戏框架模块基类。
#### 框架思路为面向接口编程如Resource资源模块开发白皮书为先定义IResourceManager的接口规范然后编写ResourceManager继承框架具体实现(GameFrameworkModule)以及实现接口。最后实现调用层GameFrameworkModuleBase调用层可以拓展编辑器供开发者自定义模块参数。
``` csharp
/// <summary>
/// 游戏框架模块抽象类。GameFrameworkModule为具体框架模块实现。
/// </summary>
internal abstract class GameFrameworkModule
{
/// <summary>
/// 获取游戏框架模块优先级。
/// </summary>
/// <remarks>优先级较高的模块会优先轮询,并且关闭操作会后进行。</remarks>
internal virtual int Priority => 0;
/// <summary>
/// 游戏框架模块轮询。
/// </summary>
/// <param name="elapseSeconds">逻辑流逝时间,以秒为单位。</param>
/// <param name="realElapseSeconds">真实流逝时间,以秒为单位。</param>
internal abstract void Update(float elapseSeconds, float realElapseSeconds);
/// <summary>
/// 关闭并清理游戏框架模块。
/// </summary>
internal abstract void Shutdown();
}
//=====================================================================//
/// <summary>
/// 游戏框架模块抽象类。GameFrameworkModuleBase 为Mono调用层。
/// </summary>
public abstract class GameFrameworkModuleBase : MonoBehaviour
{
/// <summary>
/// 游戏框架模块初始化。
/// </summary>
protected virtual void Awake()
{
GameEntry.RegisterModule(this);
}
}
```
## 常用模块接口
<strong>[3-1-资源模块](./3-1-资源模块.md)<strong>
<strong>[3-2-事件模块](./3-2-事件模块.md)<strong>
<strong>[3-3-内存池模块](./3-3-内存池模块.md)<strong>
<strong>[3-4-对象池模块](./3-4-对象池模块.md)<strong>
<strong>[3-5-UI模块](./3-5-UI模块.md)<strong>
<strong>[3-6-配置表模块](./3-6-配置表模块.md)<strong>
<strong>[3-7-流程模块](./3-7-流程模块.md)<strong>
<strong>[3-8-网络模块](./3-8-网络模块.md)<strong>