{"id":20290041,"url":"https://github.com/extrys/hybrid-ezs","last_synced_at":"2025-07-21T16:33:13.781Z","repository":{"id":48515843,"uuid":"363550846","full_name":"Extrys/Hybrid-EZS","owner":"Extrys","description":"Streamlines the transition from MonoBehaviour to DOTS in an extremely simple, modular and efficient way.","archived":false,"fork":false,"pushed_at":"2023-09-26T08:58:55.000Z","size":50,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T11:47:06.957Z","etag":null,"topics":["csharp","dots","ecs","entity-component-system","framework","unity","unity-package","unity3d"],"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/Extrys.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}},"created_at":"2021-05-02T02:35:06.000Z","updated_at":"2025-04-06T17:40:24.000Z","dependencies_parsed_at":"2022-09-10T18:02:50.319Z","dependency_job_id":"bafd9d5e-51ca-4b75-8f13-9c4d2706048d","html_url":"https://github.com/Extrys/Hybrid-EZS","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Extrys/Hybrid-EZS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extrys%2FHybrid-EZS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extrys%2FHybrid-EZS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extrys%2FHybrid-EZS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extrys%2FHybrid-EZS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Extrys","download_url":"https://codeload.github.com/Extrys/Hybrid-EZS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Extrys%2FHybrid-EZS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266334543,"owners_count":23913002,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["csharp","dots","ecs","entity-component-system","framework","unity","unity-package","unity3d"],"created_at":"2024-11-14T15:06:02.536Z","updated_at":"2025-07-21T16:33:13.759Z","avatar_url":"https://github.com/Extrys.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/38926085/117296866-d30a3400-ae75-11eb-8cea-07af9eea4d5b.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://openupm.com/packages/com.squirrelbytes.ezs/\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/com.squirrelbytes.ezs?label=openupm\u0026amp;registry_uri=https://package.openupm.com\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\nWelcome!\n\nThis repository has been created for help to streamline the transition from MonoBehaviour to DOTS in a simple and modular way  \nmaking the ECS Hybridation much easer for the developer who works with Monobehaviours  \nand giving in this way a better performance and architecture to your MonoBehaviour based projects.\n\n**As i have a slight level of dyslextia, im sory before hand for any typo you may find, feel free to contribute fixing them if you find any!**\n\n## Table Of Contents\n\n  - [Introduction](#introduction)\n  - [Features](#features)\n  - [Installation](#installation)\n  - [Basic Usage](#basic-usage)\n  - [Entity Injector](#entity-injector) (wip)\n  \t- [Entity-Injected Objects](#Entity-Injected-Objects) (wip)\n  \t- [Entity-Injected Authored IComponentData](#Entity-Injected-Authored-IComponentData) (wip)\n  \t- [Entity-Injected EntityBuffer](#Entity-Injected-EntityBuffer) (wip)\n  \t- [Entity-Injected BlobAssets](#Entity-Injected-BlobAssets) (wip)\n  - [EZ System Injection](#EZ-System-Injection) (wip)\n  \t- [Custom System Injection Example](#Custom-System-Injection-Example) (wip)\n  \t- [Authoring Systems In RealTime with Scriptable Objects](#System-Injector) (wip)\n  \t- [System Injector](#System-Injector) (wip)\n  - [EZ BlobAssets Conversion](#EZ-BlobAssets-Conversion) (wip)\n\n\n# Introduction\n- Usually the terms ECS and DOTS are confusing for new developers  \nor for experienced ones with a strong OOP mindset  \n\n- Other developers know about ECS and DOTS but are not sure how to port their projects  \n\n- There are also large projects that would be a nightmare to port to ECS, and let alone DOTS.\n\nThis project has been created to solve most of these problems  \nby focusing on offering a much smoother and faster workflow to work with Monobehaviours and entities at the same time in a hybrid way.\n\n# Features\nA few features have been made to avoid the sometimes excesive code quantity needed to work with ECS and conversions, among others, the most important are:\n\n- Custom Entity Injector\n  - Enables easier and more modular way to inject custom converted entities from a GameObject\n\n- Entity extensions\n  - Making it much easier to do operations on entities, such as add components and so\n\n- Easier Component Conversion\n  - Forget the entity conversion from unity and use way much less code making it faster to create ComponentDatas for attaching them to a GameObject\n\n- Easy entity referencing\n  - Make an entity be referenced by other entities by creating automatic entity dynamic buffers from inspector\n\n- Easy System Injection\n  - Offers a super-duper easy way to create a system with custom depencences, for example a scriptable object that you can configute on the fly while system runs\n\n\n# Installation\nEasy!  \n\n\n\nWindow \u003e Package Manager \u003e + \u003e Add package from git URL... \u003e ``com.squirrelbytes.ezs``  \n\nif that doesnt works then...  \n\nWindow \u003e Package Manager \u003e + \u003e Add package from git URL... \u003e ``https://github.com/Extrys/Hybrid-EZS.git``  \n\n\n![HowToInstall](https://user-images.githubusercontent.com/38926085/117202445-1d47d280-adee-11eb-9d8d-33ae2d93b749.png)  \n\nThere is one more thing to do!\n\nNow just need to configure the script Execution order and put \"HybridEZS.EntityInjector\" just over default   \nIts easy too just follow the next image  \n![ChangeExecutionOrder](https://user-images.githubusercontent.com/38926085/117226383-d6b99e80-ae14-11eb-9ef6-de2c26478cb1.png)\n\nApply the changes and wait a few seconds and...  \n\n***Its ready to use!***\n\n\n\n\n# Basic Usage\nOnce everything is ready to start using the EZS Hybrid workflow, you might want to start using it, otherwise I don't know what you're doing here!  \n\nLets start with a basic example!  \n\nThe EZ Cube  \n\n![GIF 05-05-2021 23-24-36](https://user-images.githubusercontent.com/38926085/117211305-1d999b00-adf9-11eb-9915-8c8b73a9310a.gif)  \n\nI know is the best thing you have seen ever but lets get to the point!\n\nWhat we have here is a Cube with a \"CoolMovement\" Script attached\n\nHere we have some variables here that makes our cube move like this\n\n\u003e **Current Oscilation Time:**  \n\u003e   Its a number that changes a lot  \n\u003e   \n\u003e **Oscilation Speed:**  \n\u003e   How fast it moves  \n\u003e   \n\u003e **Oscilation Amplitude Multiplier:**  \n\u003e   How far it moves  \n\u003e   \n\u003e **Rotation Speed:**  \n\u003e   How quickly he starts to get dizzy  \n\nAnd this script is a MonoBehaviour using a fantastic and wonderful super fast Update [*I'm being sarcastic, of course*].\n\n```csharp\npublic class CoolMovement : MonoBehaviour\n{\n\tpublic float currentOscilationTime;\n\tpublic float oscilationSpeed;\n\tpublic float oscilationAmplitude;\n\tpublic float rotationSpeed;\n\n\tvoid Update()\n\t{\n\t\tcurrentOscilationTime += oscilationSpeed * Time.deltaTime;\n\t\ttransform.position = new Vector3(0, Mathf.Sin(currentOscilationTime) * oscilationAmplitude, 0);\n\t\ttransform.rotation *= Quaternion.Euler(0, rotationSpeed * Time.deltaTime, 0);\n\t}\n}\n```\n\nOk so lets make this MonoBehaviour use a System instead, shall we?\n\n```csharp\npublic class CoolMovement : MonoBehaviour\n{\n\tpublic float currentOscilationTime;\n\tpublic float oscilationSpeed;\n\tpublic float oscilationAmplitude;\n\tpublic float rotationSpeed;\n\n\tpublic void DoUpdate() //Changed the name\n\t{\n\t\tcurrentOscilationTime += oscilationSpeed * Time.deltaTime;\n\t\ttransform.position = new Vector3(0, Mathf.Sin(currentOscilationTime) * oscilationAmplitude, 0);\n\t\ttransform.rotation *= Quaternion.Euler(0, rotationSpeed * Time.deltaTime, 0);\n\t}\n}\n\npublic class CoolMovementSystem : SystemBase\n{\n\tprotected override void OnUpdate()\n\t{\n\t\tEntities\n\t\t\t.ForEach((CoolMovement coolMovement) =\u003e coolMovement.DoUpdate())\n\t\t\t.WithoutBurst()  //Because MonoBehaviours can not be Bursted\n\t\t\t.Run(); //To run in main thread \n\t}\n}\n```\nOk done! :D\n\nWe just changed the \"Update\" for \"DoUpdate\" so we dont use the Unity one.\n\nIf we hit play right now it will ***not*** work  \nBecause the Entities.ForEach just work on entities with \"CoolMovement\"\nBut... we have not entities yet...\n\nHere comes the **Entity Injector** to the rescue!\n\n## Injecting an Entity\n\nThis is the main component that defines the workflow!  \n![image](https://user-images.githubusercontent.com/38926085/117226660-6b240100-ae15-11eb-87d6-4931e6ed0838.png)\n\nAs you see it has 3 lists, each one is for different purpouses that will be explained easier a little bit later in other section  \nbut for now just Drag N Drop the CoolMovement Component to the EntityInjector in this way:  \n![image](https://user-images.githubusercontent.com/38926085/117226852-d66dd300-ae15-11eb-8845-71843faa4e9c.png)\n\nCongratulations you have added a monobehaviour to your future entity.\n\nYou can press play, enjoy your spinning cube, sell the game and get rich!\n\nBut wait there is more...\n\nWhat about moving finally to DOTS?\n\nWe have been using this component just to make an entity having this monobehaviour attached as component, so we can query it in systems, is for that it works now just hybridizing the game will give you a little bit of performance, depending on the \"Update\" usage you have in your game  \nbut most of the times the performance gain is not so heavy, unless you start using it correctly.\n\nSo this is not the end, now the next step is to segregate the data and disintegrate the OnUpdate bit a bit until all the logic is inside the system and the references are components of the gameobject to conver them easily to data.\n\nI will be doing that transition later so you can see how easy it is.\n\nLets take apart this section to start with something more technical and a little more advanced usages on this component.\n\n\n# Entity Injector\n![image](https://user-images.githubusercontent.com/38926085/117227835-0322ea00-ae18-11eb-9197-ee9870b8c1b7.png)\n\nThis is the Entity injector monobehaviour component\nItrs preatty easy, it just injects an entity with the things added to the lists.\n\nEach list is for different kind of components, it has:\n\n**Objects:**  \nYou can put here ANYTHING you want and the generated entity will just have it.\n\n**Autoring Data:**  \nThis lists is mainly to attach custom IComponentData to entities from the AutoringComponent who are added to the list\n(We will talk about this in an easier way in the next section).\n\n**Entity Injectors**  \nHere you can reference more entity inyectors, in this way, the injected entity will index(\"have\") also a EntityBuffer\n(We will talk about this in an easier way in a later section).\n\n**Blob Assets:**  (Soon)\n\n\n(WIP)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrys%2Fhybrid-ezs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextrys%2Fhybrid-ezs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrys%2Fhybrid-ezs/lists"}