{"id":21358874,"url":"https://github.com/gameframex/com.gameframex.unity.procedure","last_synced_at":"2025-06-22T02:38:03.786Z","repository":{"id":232334907,"uuid":"784065608","full_name":"GameFrameX/com.gameframex.unity.procedure","owner":"GameFrameX","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-01T07:25:48.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-03T20:18:39.986Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GameFrameX.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-09T05:50:52.000Z","updated_at":"2025-06-01T07:25:51.000Z","dependencies_parsed_at":"2024-04-09T07:33:51.225Z","dependency_job_id":"04addb0b-f939-4a12-8f6a-fa692535b3a7","html_url":"https://github.com/GameFrameX/com.gameframex.unity.procedure","commit_stats":null,"previous_names":["alianblank/com.alianblank.gameframex.unity.procedure","gameframex/com.gameframex.unity.procedure"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/GameFrameX/com.gameframex.unity.procedure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GameFrameX%2Fcom.gameframex.unity.procedure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GameFrameX%2Fcom.gameframex.unity.procedure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GameFrameX%2Fcom.gameframex.unity.procedure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GameFrameX%2Fcom.gameframex.unity.procedure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GameFrameX","download_url":"https://codeload.github.com/GameFrameX/com.gameframex.unity.procedure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GameFrameX%2Fcom.gameframex.unity.procedure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261225922,"owners_count":23127225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T05:22:43.264Z","updated_at":"2025-06-22T02:37:58.775Z","avatar_url":"https://github.com/GameFrameX.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿## HOMEPAGE\n\nGameFrameX 的 Procedure 流程管理组件\n\n**Procedure 流程管理组件 (Procedure Component)** - 提供流程管理组件相关的接口。\n\n**该库主要服务于 `https://github.com/AlianBlank/GameFrameX.Unity` 作为子库使用。**\n\n# 依赖组件\n\n有限状态机\n\nhttps://github.com/AlianBlank/com.alianblank.gameframex.unity.fsm\n\n# 使用文档(文档编写于GPT4)\n\n# ProcedureComponent 类组件说明文档\n\n## 简介\n\n`ProcedureComponent` 类是一款用于在基于 Unity 和 Game Framework 框架开发的游戏中管理游戏流程的组件。它依赖于 `FSMComponent` (有限状态机组件) 来管理游戏中的不同阶段或状态，例如启动、菜单、游戏、暂停和结束等。\n\n## 功能\n\n此组件的主要功能包括：\n\n- 初始化流程管理器 (`IProcedureManager`)，通过 `GameFrameworkEntry` 注册并获取相关模块。\n- 在游戏启动时创建并初始化所有可用的流程 (`ProcedureBase` 类型数组)。\n- 启动游戏时，自动切换至入口流程 (`m_EntranceProcedure`)。\n- 提供方法查询、获取当前流程及其持续时间。\n\n## 依赖关系\n\n`ProcedureComponent` 需要以下组件或模块来正常工作：\n\n- `FSMComponent`：用于实现流程的有限状态机的逻辑。\n- `IProcedureManager`：一个接口，由 Game Framework 提供，管理游戏的流程状态。\n- `ProcedureBase`：用于扩展自定义具体流程的基类。\n\n请确保在使用 `ProcedureComponent` 之前，游戏项目中已经包含了这些必要的组件和模块。\n\n## 使用方法\n\n在 Unity Inspector 中，您可以设置以下属性：\n\n- `m_AvailableProcedureTypeNames`：可用流程的类型名称数组，用于在启动游戏时创建和初始化流程。\n- `m_EntranceProcedureTypeName`：启动游戏时首先进入的流程的类型名称。\n\n`ProcedureComponent` 实现了以下公共方法供外部调用：\n\n- `HasProcedure\u003cT\u003e()`：检查是否存在指定类型的流程。\n- `GetProcedure\u003cT\u003e()`：获取指定类型的流程。\n\n当您创建了自定义流程类并且想要将其注册到流程管理器时，可以添加类名到 `m_AvailableProcedureTypeNames` 数组，并将入口流程的类名设置为 `m_EntranceProcedureTypeName`。\n\n在游戏启动时，`ProcedureComponent` 会循环遍历 `m_AvailableProcedureTypeNames`，使用反射创建这些流程实例，并使用入口流程开始流程管理。\n\n## 注意事项\n\n请注意，每个流程都是继承自 `ProcedureBase` 的一个自定义类。您需要确保您的流程类正确实现了 `ProcedureBase` 定义的所有虚方法，以符合流程管理器的运行要求。\n\n此外，`ProcedureComponent` 类使用 `[DisallowMultipleComponent]` 属性标记，证明该组件不可在同一个 GameObject 上添加多次。\n\n在编写自定义流程时，您应确保它们的状态能够正确的通过 `FSMComponent` 管理，并且能够与其他流程适当切换。\n\n# 使用方式(任选其一)\n\n1. 直接在 `manifest.json` 的文件中的 `dependencies` 节点下添加以下内容\n   ```json\n      {\"com.gameframex.unity.procedure\": \"https://github.com/AlianBlank/com.gameframex.unity.procedure.git\"}\n    ```\n2. 在Unity 的`Packages Manager` 中使用`Git URL` 的方式添加库,地址为：https://github.com/AlianBlank/com.gameframex.unity.procedure.git\n\n3. 直接下载仓库放置到Unity 项目的`Packages` 目录下。会自动加载识别\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgameframex%2Fcom.gameframex.unity.procedure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgameframex%2Fcom.gameframex.unity.procedure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgameframex%2Fcom.gameframex.unity.procedure/lists"}