{"id":46303103,"url":"https://github.com/felid-force-studios/staticecs-unity","last_synced_at":"2026-04-22T12:07:03.842Z","repository":{"id":273092793,"uuid":"918629473","full_name":"Felid-Force-Studios/StaticEcs-Unity","owner":"Felid-Force-Studios","description":"C# Hierarchical Inverted Bitmap ECS framework - Unity module","archived":false,"fork":false,"pushed_at":"2026-04-05T14:33:58.000Z","size":1198,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-05T16:18:23.774Z","etag":null,"topics":["ecs","ecs-framework","entity-component-system","static-ecs","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/Felid-Force-Studios.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-18T12:50:48.000Z","updated_at":"2026-04-05T14:34:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"4cdd6e7f-cfea-4f05-a6e5-5c36975774d9","html_url":"https://github.com/Felid-Force-Studios/StaticEcs-Unity","commit_stats":null,"previous_names":["felid-force-studios/staticecs-unity"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/Felid-Force-Studios/StaticEcs-Unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felid-Force-Studios%2FStaticEcs-Unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felid-Force-Studios%2FStaticEcs-Unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felid-Force-Studios%2FStaticEcs-Unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felid-Force-Studios%2FStaticEcs-Unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Felid-Force-Studios","download_url":"https://codeload.github.com/Felid-Force-Studios/StaticEcs-Unity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felid-Force-Studios%2FStaticEcs-Unity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31835820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ecs","ecs-framework","entity-component-system","static-ecs","unity"],"created_at":"2026-03-04T11:32:32.447Z","updated_at":"2026-04-19T00:03:44.856Z","avatar_url":"https://github.com/Felid-Force-Studios.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/Felid-Force-Studios/StaticEcs/master/docs/fulllogo.png\" alt=\"Static ECS\" width=\"100%\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003ca href=\"./README.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/EN-English-blue?style=flat-square\" alt=\"English\"\u003e\u003c/a\u003e\n  \u003ca href=\"./README_RU.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/RU-Русский-blue?style=flat-square\" alt=\"Русский\"\u003e\u003c/a\u003e\n  \u003ca href=\"./README_ZH.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/ZH-中文-blue?style=flat-square\" alt=\"中文\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/badge/version-2.1.3-blue?style=for-the-badge\" alt=\"Version\"\u003e\n  \u003ca href=\"https://felid-force-studios.github.io/StaticEcs/en/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Docs-documentation-blueviolet?style=for-the-badge\" alt=\"Documentation\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Felid-Force-Studios/StaticEcs\"\u003e\u003cimg src=\"https://img.shields.io/badge/Core-framework-green?style=for-the-badge\" alt=\"Core framework\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Felid-Force-Studios/StaticEcs-Showcase\"\u003e\u003cimg src=\"https://img.shields.io/badge/Showcase-examples-yellow?style=for-the-badge\" alt=\"Showcase\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Static ECS - C# Entity component system framework - Unity module\n\n## Table of Contents\n* [Contacts](#contacts)\n* [Installation](#installation)\n* [Guide](#guide)\n  * [Connection](#connection)\n  * [Entity providers](#entity-providers)\n  * [Event providers](#event-providers)\n  * [Unity event providers](#unity-event-providers)\n  * [Templates](#templates)\n  * [Static ECS view window](#static-ecs-view-window)\n  * [Settings](#settings)\n* [Questions](#questions)\n* [License](#license)\n\n\n# Contacts\n* [Telegram](https://t.me/felid_force_studios)\n\n# Installation\nMust also be installed [StaticEcs](https://github.com/Felid-Force-Studios/StaticEcs)\n* ### As source code\n  From the release page or as an archive from the branch. In the `master` branch there is a stable tested version\n* ### Installation for Unity\n  - As a git module in Unity PackageManager     \n    `https://github.com/Felid-Force-Studios/StaticEcs-Unity.git`\n  - Or adding to the manifest `Packages/manifest.json`  \n    `\"com.felid-force-studios.static-ecs-unity\": \"https://github.com/Felid-Force-Studios/StaticEcs-Unity.git\"`\n\n\n# Guide\nThe module provides additional integration options with the Unity engine:\n\n### Connection:\nECS runtime data monitoring and management window  \nTo connect worlds and systems to the editor window it is necessary to call a special method when initializing the world and systems  \nspecifying the world or systems required\n```csharp\n        ClientWorld.Create(WorldConfig.Default());\n        ClientSystems.Create();\n        \n        EcsDebug\u003cClientWorldType\u003e.AddWorld\u003cClientSystemsType\u003e();\n        \n        ClientWorld.Initialize();\n        ClientSystems.Initialize();\n```\n\nTo add additional system groups to the debug window, use `AddSystem` after the systems are initialized:\n```csharp\n        ClientWorld.Create(WorldConfig.Default());\n        ClientSystems.Create();\n        ClientAdditionalSystems.Create();\n        \n        EcsDebug\u003cClientWorldType\u003e.AddWorld\u003cClientSystemsType\u003e();\n        \n        ClientWorld.Initialize();\n        ClientSystems.Initialize();\n        ClientAdditionalSystems.Initialize();\n        \n        EcsDebug\u003cClientWorldType\u003e.AddSystem\u003cClientAdditionalSystemsType\u003e();\n```\nNote: `AddWorld` must be called before `Initialize` (it registers the debug system), while `AddSystem` must be called after `Initialize` (systems must already be initialized)\n\n### Entity providers:\nA script that adds the ability to configure an entity in the Unity editor and automatically create it in the ECS world  \nAdd the `StaticEcsEntityProvider` script to an object in the scene:\n\n![EntityProvider.png](Readme%2FEntityProvider.png)\n\n`Usage type` - creation type, automatically when `Start()`, `Awake()` is called, or manually  \n`On create type` - action after creating the provider, delete the `StaticEcsEntityProvider` component from the object, delete the entire object, or nothing  \n`On destroy type` - action when destroying the provider, destroy the entity or nothing  \n`Prefab` - allows referring to the provider prefab, while changing component data will be blocked  \n`Entity GID` - global entity identifier in runtime  \n`Disable entity on create` - disables entity immediately after creation  \n`On enable and disable` - enables/disables entity when GameObject is enabled/disabled  \n`Entity Type` - entity type  \n`Cluster ID` - cluster identifier in runtime  \n`Components` - component data  \n`Tags` - entity tags\n\n### Event providers:\nA script that adds the ability to configure an event in the Unity editor and automatically send it to the ECS world  \nAdd the `StaticEcsEventProvider` script to an object in the scene:\n\n![EventProvider.png](Readme%2FEventProvider.png)\n\n`Usage type` - creation type, automatically when `Start()`, `Awake()` is called, or manually  \n`On create type` - action after creation, delete the `StaticEcsEventProvider` component from the object, delete the entire object, or nothing  \n`World` - type of world in which the event will be sent  \n`Type` - event type\n\n\n### Unity event providers:\nA system of providers for automatic forwarding of Unity events (physics, GUI) to the ECS world  \nProviders intercept Unity callbacks (OnCollisionEnter, IPointerClickHandler, etc.) and send corresponding ECS events  \n\n#### Type registration\n\nBefore using providers, you must register event and component types in the world  \nCall `UnityEventTypes.Register\u003cTWorld\u003e()` between `Create()` and `Initialize()`:\n```csharp\n        ClientWorld.Create(WorldConfig.Default());\n        UnityEventTypes.Register\u003cClientWorldType\u003e(); // Registers all events and components\n        ClientWorld.Initialize();\n```\nThe method automatically registers all module event and component types, respecting installed modules (Physics, Physics2D, TextMeshPro)  \n\nAlternatively, you can use `RegisterAll` to automatically register all types from specified assemblies via reflection:\n```csharp\n        ClientWorld.Create(WorldConfig.Default());\n        ClientWorld.Types().RegisterAll(typeof(MyComponent).Assembly); // All IComponent, IEvent, ITag from assembly\n        ClientWorld.Initialize();\n```\n`RegisterAll` without parameters uses the calling assembly. Multiple assemblies can be passed  \n\n#### Three operating modes\n\n| Mode | Class suffix | Description |\n|---|---|---|\n| Without entity | `Provider\u003cTWorld\u003e` | Sends event to the ECS world without entity binding |\n| EntityGID | `EntityGIDProvider\u003cTWorld\u003e` | Binds to entity via EntityGID field |\n| EntityRef | `EntityRefProvider\u003cTWorld, TProvider\u003e` | Binds via reference to StaticEcsEntityProvider |\n\n**Mode without entity** - sends the event without EntityGID. Suitable for objects not associated with ECS entities  \n\n**EntityGID mode** - stores EntityGID as a serializable field. Sends event with EntityGID  \n\n**EntityRef mode** - stores a reference to a `StaticEcsEntityProvider` component. Gets EntityGID from the provider at runtime. Convenient when the entity provider is on the same or adjacent object  \n\n#### EntityEventMode\n\nEntity providers (EntityGID/EntityRef) have a configurable `EntityEventMode` field in the Inspector that controls behavior:\n\n| Mode | Description |\n|---|---|\n| `All` | Sends events **and** manages state components |\n| `EventOnly` | Only sends ECS events, without component management (default) |\n| `ComponentOnly` | Only manages state components on the entity, without sending events |\n\nSetting from code:\n```csharp\nGetComponent\u003cMyCollision3DEntityGID\u003e().SetEntityEventMode(EntityEventMode.All);\n```\n\n#### Generating providers\n\nSince Unity does not support serialization of open generic types, you need to create sealed subclasses for a specific world  \n\nFor quick generation use: `Assets/Create/Static ECS/Providers`\n\nThe generation window allows you to configure:\n- **World** - the world type for which providers are generated\n- **Namespace** - namespace for generated classes\n- **Prefix** - class name prefix (defaults to world name)\n- **Event providers** - checkboxes for selecting event categories:\n  - GUI - basic GUI events (Click, Drag, Drop, Pointer, ScrollView, Slider, SubmitCancel, ButtonClick)\n  - TextMeshPro - TMP widget events (Dropdown, Input)\n  - Mouse - mouse events (MouseDownUp, MouseEnterExit, MouseUpAsButton)\n  - Physics 3D - 3D physics events (Collision, Trigger, ControllerColliderHit)\n  - Physics 2D - 2D physics events (Collision, Trigger)\n  - Animation - animation events (AnimationEvent, StateMachineBehaviour, StateMachineBehaviourLinker)\n\nAs a result, sealed classes ready to use in Unity Inspector will be generated  \nFor each event type, 3 classes are generated (one for each mode):\n```\n{Prefix}Click          : ClickProvider\u003cTWorld\u003e              // without entity\n{Prefix}ClickEntityGID : ClickEntityGIDProvider\u003cTWorld\u003e     // with EntityGID\n{Prefix}ClickEntityRef : ClickEntityRefProvider\u003cTWorld, TProvider\u003e // with provider\n```\n\n#### Supported events\n\n**Physics 3D** (requires `com.unity.modules.physics`):\n\n| Provider | Unity Callback | Events | State component |\n|---|---|---|---|\n| Collision3D | OnCollisionEnter/Exit | `CollisionEnter3DEvent`, `CollisionExit3DEvent` | `Collision3DState` |\n| Trigger3D | OnTriggerEnter/Exit | `TriggerEnter3DEvent`, `TriggerExit3DEvent` | `Trigger3DState` |\n| ControllerColliderHit3D | OnControllerColliderHit | `ControllerColliderHit3DEvent` | - |\n\n**Physics 3D — ContactEvent** (requires `com.unity.modules.physics`, Unity 2022.2+):\n\nCentralized high-performance alternative to per-object MonoBehaviour callbacks. Uses `Physics.ContactEvent` — a batch callback receiving all contacts in the scene in a single call. Does not require a MonoBehaviour on every physics object.\n\n**Architecture:**\n- **Listener** — one per scene. Subscribes to `Physics.ContactEvent` and processes all contacts centrally\n- **ContactColliderProvider** — on each GameObject with colliders (entity variant only). Registers colliders in the mapping\n\n**Two listener variants:**\n\n| Listener | Events | State component | Entity mapping |\n|---|---|---|---|\n| `ContactEventListener\u003cTWorld\u003e` | `ContactEnter3DEvent`, `ContactExit3DEvent` | - | Not required |\n| `ContactEventEntityListener\u003cTWorld\u003e` | `ContactEnter3DEntityEvent`, `ContactExit3DEntityEvent` | `ContactCollision3DState` | Via `ContactColliderEntityMap` |\n\n`ContactEventListener\u003cTWorld\u003e` — sends events with collider data only, without entity binding. One component on a scene manager object.\n\n`ContactEventEntityListener\u003cTWorld\u003e` — sends events with EntityGID of both bodies, using `ContactColliderEntityMap` world resource for Collider InstanceID → EntityGID mapping. One component on a scene manager object. Options: `sendNonEntityEvents`, `manageComponents`.\n\n**Collider registration (entity variant only):**\n\n`ContactColliderProvider\u003cTWorld\u003e` — MonoBehaviour placed on each GameObject with colliders. Registers colliders in `ContactColliderEntityMap` and automatically sets `providesContacts = true`. Two variants:\n- `ContactColliderGIDProvider\u003cTWorld\u003e` — serialized EntityGID\n- `ContactColliderRefProvider\u003cTWorld, TProvider\u003e` — reference to StaticEcsEntityProvider\n\nThe `ContactColliderEntityMap` resource is created lazily on first provider registration.\n\nContact events contain data about both colliders:\n```csharp\npublic struct ContactEnter3DEntityEvent : IEvent {\n    public EntityGID EntityA;\n    public EntityGID EntityB;\n    public Collider ColliderA;\n    public Collider ColliderB;\n    public Vector3 Point;\n    public Vector3 Normal;\n    public Vector3 Impulse;\n}\n```\n\n\u003e **Note:** `Physics.ContactEvent` only reports actual collisions, not triggers. For triggers, use the standard `Trigger3D` providers.\n\n**Physics 2D** (requires `com.unity.modules.physics2d`):\n\n| Provider | Unity Callback | Events | State component |\n|---|---|---|---|\n| Collision2D | OnCollisionEnter2D/Exit2D | `CollisionEnter2DEvent`, `CollisionExit2DEvent` | `Collision2DState` |\n| Trigger2D | OnTriggerEnter2D/Exit2D | `TriggerEnter2DEvent`, `TriggerExit2DEvent` | `Trigger2DState` |\n\n**GUI**:\n\n| Provider | Unity Interface | Events | State component |\n|---|---|---|---|\n| Click | IPointerClickHandler | `ClickEvent` | - |\n| PointerEnterExit | IPointerEnter/ExitHandler | `PointerEnterEvent`, `PointerExitEvent` | `PointerHoverState` |\n| PointerUpDown | IPointerUp/DownHandler | `PointerUpEvent`, `PointerDownEvent` | `PointerPressedState` |\n| Drag | IBeginDrag/IDrag/IEndDragHandler | `DragStartEvent`, `DragMoveEvent`, `DragEndEvent` | `DragState` |\n| Drop | IDropHandler | `DropEvent` | - |\n| ScrollView | ScrollRect.onValueChanged | `ScrollViewChangeEvent` | - |\n| SliderChange | Slider.onValueChanged | `SliderChangeEvent` | - |\n| SubmitCancel | ISubmitHandler/ICancelHandler | `SubmitEvent`, `CancelEvent` | - |\n| ButtonClick | Button.onClick | `ButtonClickEvent` | - |\n\n**GUI TMP** (requires `com.unity.textmeshpro` or `com.unity.ugui` \u003e= 2.0.0):\n\n| Provider | Unity Callback | Events |\n|---|---|---|\n| DropdownChange | TMP_Dropdown.onValueChanged | `DropdownChangeEvent` |\n| InputChange | TMP_InputField.onValueChanged | `InputChangeEvent` |\n| InputEnd | TMP_InputField.onEndEdit | `InputEndEvent` |\n\n**Mouse** (requires a collider on the object):\n\n| Provider | Unity Callback | Events | State component |\n|---|---|---|---|\n| MouseDownUp | OnMouseDown/Up | `MouseDownEvent`, `MouseUpEvent` | `MousePressedState` |\n| MouseEnterExit | OnMouseEnter/Exit | `MouseEnterEvent`, `MouseExitEvent` | `MouseHoverState` |\n| MouseUpAsButton | OnMouseUpAsButton | `MouseUpAsButtonEvent` | - |\n\n**Animation** (requires `com.unity.modules.animation`):\n\n| Provider | Unity Callback | Events | State component |\n|---|---|---|---|\n| AnimationEvent | Animation Event (clip) | `AnimationEventEcsEvent` | - |\n| StateMachineBehaviour | OnStateEnter/Exit | `AnimatorStateEnterEvent`, `AnimatorStateExitEvent` | - |\n\n`AnimationEventProvider` — place on the same GameObject as the Animator. In the animation clip, set the event function name to `OnAnimationEvent`. The event carries `stringParameter`, `intParameter`, `floatParameter`, `objectReferenceParameter` and `animationState`.\n\n`StaticEcsStateMachineBehaviour` — add to Animator Controller states. Not a MonoBehaviour — inherits from `StateMachineBehaviour`. Entity variant (`StaticEcsEntityStateMachineBehaviour`) stores a serialized `EntityGID` field.\n\n`StaticEcsStateMachineBehaviourLinker` — a MonoBehaviour placed on the same GameObject as the Animator. Stores a reference to `StaticEcsEntityProvider` and on `Start()` automatically calls `SetEntityGID()` on all `StaticEcsEntityStateMachineBehaviour` found in the Animator Controller. Has a public `Link()` method for manual re-linking (e.g. after changing entities at runtime).\n\nFor entity modes, events have the `Entity` suffix: `ClickEntityEvent`, `CollisionEnter3DEntityEvent`, `MouseDownEntityEvent`, etc.  \nThese events contain an additional `EntityGID` field\n\n#### State components\n\nState components are automatically managed by entity providers (EntityGID/EntityRef):  \n- Added to the entity on Enter event\n- Removed from the entity on Exit event\n- Updated on Move/Update event (e.g. `DragState`)\n\n```csharp\npublic struct Collision3DState : IComponent {\n    public Collider Collider;\n    public Vector3 Point;\n    public Vector3 Normal;\n    public Vector3 Velocity;\n}\n\npublic struct DragState : IComponent {\n    public Vector2 Position;\n    public int PointerId;\n    public Vector2 Delta;\n    public PointerEventData.InputButton Button;\n}\n\npublic struct PointerHoverState : IComponent { }\npublic struct PointerPressedState : IComponent { }\n```\n\n#### Validation\n\nAll providers check `CanSend()` before sending:\n- **Base check**: world is initialized (`World\u003cTWorld\u003e.Status == WorldStatus.Initialized`)\n- **GUI check**: additionally checks that `Selectable.interactable == true` (if assigned)\n- **Entity check**: `EntityGID.TryUnpack\u003cTWorld\u003e()` verifies the entity is alive before setting/deleting components\n\n#### Customization\n\nAll event sending and component management methods are `virtual` and can be overridden:\n\n```csharp\npublic sealed class MyCollision3D : Collision3DProvider\u003cMyWorldType\u003e {\n    protected override bool CanSend() {\n        return base.CanSend() \u0026\u0026 gameObject.activeInHierarchy;\n    }\n\n    protected override void OnSendEnterEvent(Collision data) {\n        // Custom logic instead of or in addition to base\n        base.OnSendEnterEvent(data);\n    }\n}\n```\n\nFor entity providers, the following are also available:\n```csharp\nprotected override void OnAddComponent(Collision data) { ... }\nprotected override void OnRemoveComponent() { ... }\n```\n\n#### Setting EntityGID / EntityProvider from code\n\n```csharp\n// For EntityGID providers\nGetComponent\u003cMyCollision3DEntityGID\u003e().SetEntityGID(entityGid);\n\n// For EntityRef providers\nGetComponent\u003cMyCollision3DEntityRef\u003e().SetEntityProvider(entityProvider);\n```\n\n#### Usage example\n\n```csharp\nusing W = World\u003cMyWorldType\u003e;\n\n// 1. Generate providers: Assets/Create/Static ECS/Providers\n// 2. Add the required provider component to a GameObject\n// 3. Register event receivers and handle events in a system:\n\npublic struct HandleClickSystem : IInitSystem, IUpdateSystem {\n    private EventReceiver\u003cMyWorldType, ClickEvent\u003e _receiver;\n\n    public void Init() {\n        _receiver = W.RegisterEventReceiver\u003cClickEvent\u003e();\n    }\n\n    public void Update() {\n        foreach (var evt in _receiver) {\n            ref var data = ref evt.Value;\n            Debug.Log($\"Click on {data.Ref.name} at {data.Position}\");\n        }\n    }\n}\n\n// Or for entity events:\npublic struct HandleCollisionSystem : IInitSystem, IUpdateSystem {\n    private EventReceiver\u003cMyWorldType, CollisionEnter3DEntityEvent\u003e _receiver;\n\n    public void Init() {\n        _receiver = W.RegisterEventReceiver\u003cCollisionEnter3DEntityEvent\u003e();\n    }\n\n    public void Update() {\n        foreach (var evt in _receiver) {\n            if (evt.Value.EntityGID.TryUnpack\u003cMyWorldType\u003e(out var entity)) {\n                // Handle collision for a specific entity\n            }\n        }\n    }\n}\n\n// Or use state components (EntityEventMode.ComponentOnly / EntityEventMode.All):\n// Components are automatically added on enter and removed on exit\npublic struct HandleCollisionStateSystem : IUpdateSystem {\n    public void Update() {\n        foreach (var entity in W.Query\u003cAll\u003cCollision3DState\u003e\u003e().Entities()) {\n            ref var state = ref entity.Ref\u003cCollision3DState\u003e();\n            Debug.Log($\"Entity is colliding with {state.Collider.name}, velocity: {state.Velocity}\");\n        }\n    }\n}\n```\n\n\u003e **Note:** State components are fully compatible with [change tracking](https://felid-force-studios.github.io/StaticEcs/en/features/tracking.html). Components are added/removed from Unity callbacks (FixedUpdate), and tracking bits are written to the current tick. Systems in both FixedUpdate and Update will see these changes as long as `W.Tick()` is called at the end of Update. For example, you can use `AllAdded\u003cCollision3DState\u003e` to detect the moment a collision begins:\n\u003e ```csharp\n\u003e foreach (var entity in W.Query\u003cAll\u003cCollision3DState\u003e, AllAdded\u003cCollision3DState\u003e\u003e().Entities()) {\n\u003e }\n\u003e ```\n\n## Templates:\nClass generators are available in the `Assets/Create/Static ECS/` asset creation menu\n\n### Providers\nGenerator for sealed providers for a specific world  \nSee [Unity event providers](#unity-event-providers) section for details\n\n## Static ECS view window:\n![WindowMenu.png](Readme%2FWindowMenu.png)\n\n### Entities/Table - entity view table\n\n![EntitiesTable.png](Readme%2FEntitiesTable.png)\n- `Filter` allows select the necessary entities\n- `Entity GID` allows to find an entity by its global identifier\n- `Select` allows to select the columns to be displayed\n- `Show data` allows to select the data to be displayed in the columns\n- `Max entities result` maximum number of displayed entities\n\nTo display component data in a table, you must: set the `StaticEcsEditorTableValue` attribute in the component for field or property\n```csharp\npublic struct Position : IComponent {\n    [StaticEcsEditorTableValue]\n    public Vector3 Val;\n}\n```\nTo display a different component name, you must set the `StaticEcsEditorName` attribute on the component\n```csharp\n[StaticEcsEditorName(\"My velocity\")]\npublic struct Velocity : IComponent {\n    [StaticEcsEditorTableValue]\n    public float Val;\n}\n```\nTo set the color of the component, you must set the `StaticEcsEditorColor` attribute in the component (you can set RGB or HEX color)\n```csharp\n[StaticEcsEditorColor(\"f7796a\")]\npublic struct Velocity : IComponent {\n    [StaticEcsEditorTableValue]\n    public float Val;\n}\n```\n\nentity control buttons are also available  \n- eye icon - open the entity for viewing\n- lock - lock the entity in the table\n- trash - destroy the entity in the world\n\n\n### Viewer - entity view window\nDisplays all entity data with the ability to modify, add and delete components\n\n![EntitiesViewer.png](Readme%2FEntitiesViewer.png)\n\nBy default, only **public** object fields marked with the attribute `[Serializable]`\n- To display a private field, you must mark it with the attribute `[StaticEcsEditorShow]`\n- To hide a public field, you must mark it with the attribute `[StaticEcsEditorHide]`\n- To disable value editing in play mode, you can mark it with the attribute `[StaticEcsEditorRuntimeReadOnly]`\n```csharp\npublic struct SomeComponent : IComponent {\n    [StaticEcsEditorShow]\n    [StaticEcsEditorRuntimeReadOnly]\n    private int _showData;\n    \n    [StaticEcsEditorHide]\n    public int HideData;\n}\n```\n\n### Entities/Builder - entity constructor\nAllows you to customize and create a new entity at runtime (Similar to entity provider)\n\n![EntitiesBuilder.png](Readme%2FEntitiesBuilder.png)\n\n### Stats - statistics window\nDisplays all world, component and event data\n\n![Stats.png](Readme%2FStats.png)\n\n### Events/Table - event table\nDisplays recent events, their details and the number of subscribers who have not read the event\n\n![EventsTable.png](Readme%2FEventsTable.png)\n\nEvents marked in yellow mean they are suppressed  \nEvents marked in gray mean that they have been read by all subscribers\n\nTo display these components in a table, you must set the `StaticEcsEditorTableValue` attribute in the event for field or property\n```csharp\npublic struct DamageEvent : IEvent {\n    public float Val;\n\n    [StaticEcsEditorTableValue]\n    public string ShowData =\u003e $\"Damage {Val}\";\n}\n```\nThe `StaticEcsEditorColor` attribute must be set to set the event color (can be set to RGB or HEX color)\n```csharp\n[StaticEcsEditorColor(\"f7796a\")]\npublic struct DamageEvent : IEvent {\n\n}\n```\nThe `StaticEcsIgnoreEvent` attribute must be set to ignore the event in the editor\n```csharp\n[StaticEcsIgnoreEvent]\npublic struct DamageEvent : IEvent {\n\n}\n```\n\n### Viewer - event viewer\nAllows you to view and modify (unread only) event data\n\n![EventsViewer.png](Readme%2FEventsViewer.png)\n\n### Events/Builder - event constructor\nAllows you to configure and create a new event at runtime\n\n![EventsBuilder.png](Readme%2FEventsBuilder.png)\n\n\n### Systems\nDisplays all systems in the order in which they are executed  \nAllows turning systems on and off during runtime    \nDisplays the average execution time of each system  \n\n![Systems.png](Readme%2FSystems.png)\n\n### Settings\nAllows you to configure the editor window behavior. Settings are stored in a `StaticEcsViewConfig` ScriptableObject asset that is automatically created on first use.\n\n- **Config asset** — reference to the active config. You can create multiple configs via `Assets/Create/Static ECS/View Config` and switch between them\n- **Component Foldouts** — controls automatic expansion of component foldouts on entities:\n  - `ExpandAll` — all components are expanded by default\n  - `CollapseAll` — all components are collapsed by default\n  - `Custom` — only selected component types are auto-expanded\n- **Reset config to defaults** — resets all settings for the current world to defaults\n\nSettings are persisted between sessions. The following state is saved:\n- Selected tab, draw rate\n- Entity table: visible columns, sort column, pinned entities, filters, max entity count\n- Event table: event type filters, auto-scroll mode\n- Stats: fragmentation threshold, show unregistered toggle\n- Systems: max nesting depth for system property display\n\nSettings are auto-saved periodically (every 30 seconds) and on play mode exit.\n\n# Questions\n### How to create a custom drawing method for a type?\nTo implement your own editor for a specific type, create a `PropertyDrawer` with the `[CustomPropertyDrawer]` attribute in the Editor folder of your project  \n\nExample:\n```csharp\n[CustomPropertyDrawer(typeof(MyStruct))]\npublic class MyStructPropertyDrawer : PropertyDrawer {\n    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {\n        EditorGUI.BeginProperty(position, label, property);\n        // Custom drawing logic\n        EditorGUI.EndProperty();\n    }\n}\n```\n\n### How to use attributes without having a dependency on this module?\nIt is necessary to copy the attributes by saving the namespace from `\\Runtime\\Attributes.cs`, after that the attributes will be correctly detected by the editor.\n\n\n# License\n[MIT license](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelid-force-studios%2Fstaticecs-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelid-force-studios%2Fstaticecs-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelid-force-studios%2Fstaticecs-unity/lists"}