# com.gameframex.unity.procedure
**Repository Path**: gameframex/com.gameframex.unity.procedure
## Basic Information
- **Project Name**: com.gameframex.unity.procedure
- **Description**: GameFrameX Unity Procedure component providing procedure state management with transitions for game flow control
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: https://gameframex.doc.alianblank.com
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-07-23
- **Last Updated**: 2026-07-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README

# Game Frame X Procedure
[](https://github.com/GameFrameX/com.gameframex.unity.procedure/blob/main/LICENSE.md)
[](https://github.com/GameFrameX/com.gameframex.unity.procedure/releases)
[](https://unity.com/)
[](https://gameframex.doc.alianblank.com)
独立游戏前后端一体化解决方案 · 独立游戏开发者的圆梦大使
[文档](https://gameframex.doc.alianblank.com) · [快速开始](#快速开始) · QQ群: 467608841 / 233840761
[English](README.md) | **简体中文** | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
## 语言
[English](README.md) | **简体中文** | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
---
## 项目简介
基于有限状态机(FSM)的 Unity 游戏流程管理包。通过可切换的流程状态驱动游戏生命周期阶段(闪屏、预加载、登录、主菜单等),提供完整生命周期回调,并支持灵活的状态切换机制。
## 架构设计
```
ProcedureComponent (MonoBehaviour)
└─ IProcedureManager (接口)
└─ ProcedureManager (管理 FSM)
└─ ProcedureBase (抽象类,每个流程的逻辑)
```
- **ProcedureComponent** — Unity 组件,通过 Inspector 注册流程和入口流程,支持两种启动模式。
- **ProcedureManager** — 核心管理器,通过 `IFsmManager` 创建内部 FSM 驱动流程状态切换。
- **ProcedureBase** — 抽象基类,提供生命周期回调:`OnInit`、`OnEnter`、`OnUpdate`、`OnFixedUpdate`、`OnLeave`、`OnDestroy`。
## 依赖关系
- [com.gameframex.unity.fsm](https://github.com/GameFrameX/com.gameframex.unity.fsm) — 有限状态机
## 快速开始
### 安装
选择以下任一方式:
1. 编辑 Unity 项目的 `Packages/manifest.json`,添加 `scopedRegistries` 部分:
```json
{
"scopedRegistries": [
{
"name": "GameFrameX",
"url": "https://gameframex.upm.alianblank.uk",
"scopes": [
"com.gameframex"
]
}
],
"dependencies": {
"com.gameframex.unity.procedure": "1.2.2"
}
}
```
`scopes` 控制哪些包通过此注册表解析。只有以 `com.gameframex` 开头的包才会从这个注册表获取。
2. 直接在 `manifest.json` 的 `dependencies` 节点下添加以下内容:
```json
{
"com.gameframex.unity.procedure": "https://github.com/gameframex/com.gameframex.unity.procedure.git"
}
```
3. 在 Unity 的 `Package Manager` 中使用 `Git URL` 的方式添加库,地址为:`https://github.com/gameframex/com.gameframex.unity.procedure.git`
4. 直接下载仓库放置到 Unity 项目的 `Packages` 目录下,会自动加载识别。
### 创建流程类
```csharp
public class ProcedurePreload : ProcedureBase
{
protected internal override void OnEnter(IFsm