{"id":39425700,"url":"https://github.com/eastlaugh/autumn-unity-framework","last_synced_at":"2026-01-18T04:00:01.027Z","repository":{"id":182735720,"uuid":"613786059","full_name":"eastLaugh/Autumn-Unity-Framework","owner":"eastLaugh","description":"Autumn : Based on Unity, a lightweight, progressive, extensive and easy IOC Framework.                                     千秋 ：面向Unity的轻量级、渐进式、开箱即用、可扩展的IOC容器框架。","archived":false,"fork":false,"pushed_at":"2025-12-04T08:55:48.000Z","size":115,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-07T16:26:38.589Z","etag":null,"topics":["ioc","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eastLaugh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-14T09:14:42.000Z","updated_at":"2025-12-04T08:55:52.000Z","dependencies_parsed_at":"2023-07-21T07:49:40.573Z","dependency_job_id":null,"html_url":"https://github.com/eastLaugh/Autumn-Unity-Framework","commit_stats":null,"previous_names":["eastlaugh/autumn-unity-framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eastLaugh/Autumn-Unity-Framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastLaugh%2FAutumn-Unity-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastLaugh%2FAutumn-Unity-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastLaugh%2FAutumn-Unity-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastLaugh%2FAutumn-Unity-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eastLaugh","download_url":"https://codeload.github.com/eastLaugh/Autumn-Unity-Framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eastLaugh%2FAutumn-Unity-Framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28529455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ioc","unity"],"created_at":"2026-01-18T04:00:00.184Z","updated_at":"2026-01-18T04:00:01.017Z","avatar_url":"https://github.com/eastLaugh.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003e🍃🍃🍃\u003c/h3\u003e\n  \u003ch3 align=\"center\"\u003e🍃🍃🍃\u003c/h3\u003e\n  \u003ch3 align=\"center\"\u003e🍃🍃🍃\u003c/h3\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003eAutumn\u003c/h3\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003e千秋\u003c/h3\u003e\n\u003c/p\u003e  \n\n\n面向Unity的轻量级、渐进式、开箱即用、可扩展的IOC框架。\n\n- 轻量级：AutumnCore核心代码仅占约400行。\n- 渐进式：在你需要的任何地方、任何时机引入并享用。\n- 开箱即用：引入Autumn后，零配置，零代码，通过[特性]与框架交互。\n- 可扩展：你可以自己编写插件，来改变Autumn组织Bean的方式。\n\n# 使用方法\n直接将本仓库的所有文件放入Unity中即可。Examples目录及目录下文件仅供参考，可删除。\n\n# 案例/快速上手\n\n```Autumn-Unity-Framework/Examples/*.cs```\n\n# 生命周期\n![image](https://user-images.githubusercontent.com/39405923/225812457-45fe599f-9b87-472d-b236-082966cf1333.png)\n\n# API\n\nAutumn的API极其精简。大部分常用API均为C#特性，无需代码。\n\n## 用于类的特性\n\n- [Bean]\n\n将一个类标记为Bean。启动后，Autumn将维护该类型为单例。\n\n注意：Autumn会自动实例化该单例，无需手动实例化。因此你需要确保你的类型没有带参数的构造函数、私有的构造函数。\n\n- [Beans]\n\nBeans是Bean的容量扩增。支持多个实例。\n\n注意：Autumn不会自动实例化给类型，也不会维护单例性。所以被Beans标记的类型实例，需要通过调用Autumn API手动添加。\n\n- [Config]\n\nConfig的本质是加装了插件Configurationer的Beans。[Config]适用于ScriptableObject，游戏启动时，会自动调取Resources目录下的ScriptableObject并作为Bean添加。在装配时，可以指定对应的ScriptableObject注入。例如，使用[Autowired(\"生产环境\")]装配名为生产环境的ScriptableObject。\n\n## 用于字段的特性\n\n- [Autowired]\n\n自动装配。游戏运行时，Autumn以字段的类型为依据，自动为被[Autowired]标记的字段注入已有的Bean。如果该类型有多个实例（Beans），Autumn会尝试用列表或数组注入字段。\n\n- [Autowired(object msg)]\n\n在自动装配时传入msg，用于与插件、Filter API通讯。例如，装配[Config]标记的类型时，使用[Autowired(\"生产环境\")]会装配名称为生产环境的ScriptableObject。\n\n## 代码\n\n- using AutumnFramework;\n\n这是必须的操作。你也可以自动引用命名空间，以VSCODE为例，输入[Bean]后，提示Bean不存在，这时按下 Ctrl + . 选择第一项，将自动引入AutumnFramework命名空间。\n\n- this.Bean();\n\n将自己装配进Autumn中。\n\n\nExample\n```\n[Beans]   //Autumn已经知道要管理System的多个实例啦\npublic class System:Monobehaviour{\n  void Start(){\n    this.Bean();   //告诉Autumn自己需要被管理\n  }\n  [Autowired]    //在任何想注入的地方注入\n  private System[] systems;\n}\n\n```\n如果你真的想零代码，连this.Bean();也不想输入，可以使用[Beans_ObjectAutoSetup]标记类型，它本质上是加装了插件的Beans，它会自动调用UnityEngine.FindObjectsOfType来查找。不过，不推荐使用，因为它是不可控的。\n\n- this.UnBean();\n\n将自己取消装配。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feastlaugh%2Fautumn-unity-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feastlaugh%2Fautumn-unity-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feastlaugh%2Fautumn-unity-framework/lists"}