How friflo/friflo-ecs-unity works
Main Components
• Unity Editor Integration:
• Scripts/Editor: Contains components, drawers, popups, and UI tools that integrate with the Unity Editor.
• These elements handle things like hierarchy display, property drawing, and special customization for ECS entities.
• Runtime Functionality:
• Scripts/Runtime: Hosts the core ECS components, such as entity definitions, hubs, stores, systems, serialization, and internal logic.
• The runtime is where the ECS logic (e.g., system processing, state management) is implemented.
• Plugin System:
• Plugins: Contains XML plugin configurations for different aspects of the ECS extension (like Boost, JSON, and Annotation related plugins) that extend or configure the engine.
• Samples/Example Code:
• Samples: Provides example implementations (e.g., MoveSystem.cs) that demonstrate usage of the ECS components.
• Web and Documentation Assets:
Relationships and Interactions
• The runtime systems (Scripts/Runtime) manage the core ECS logic, including data storage, entity-component management, and system updates.
• Plugin files configure or extend the base ECS engine; they might be loaded dynamically or used at build time.
• The web-based components (located in www) suggest additional external interfaces—for example, a graphical explorer and API documentation using Swagger.
• Integration points include:
• Custom drawers and styles in the Editor that reflect the underlying runtime state.
• An HTTP server (found in Scripts/Runtime/Internal/HubHttpServer.cs) that might serve backend data to the web components.
• Testing frameworks under Scripts/Tests ensure that both editor and runtime systems behave as expected.
Architectural Patterns and Design Principles
• The project leverages separation of concerns by splitting the system into clearly distinct areas: Editor enhancements versus runtime ECS logic.
• The use of plugins implies a modular design where functionality can be extended or swapped based on configuration.
• The organization into directories like “Base,” “Components,” “Systems,” “Internal,” etc., indicates a layered approach, where base functionality is extended by concrete implementations (e.g., ECSHub, ECSStore).
• The Editor integration adheres to MVC-like or MVVM-like patterns typical in Unity editor scripting—keeping the UI (drawers, popups) separate from logic.
Detailed Steps for the Engineer
2. Within each section, break down further:
• In the Editor block, add subcomponents: Drawers, Popups, Styles, and System Trees.
• In the Runtime block, create sub-blocks for Base/Components, ECS Systems, Internal Utilities (like HTTP server and Serialization), and Unity Editor bridges.
• For Plugins, list out the individual XML configurations that extend functionality.
• For instance, from the Editor’s “Component Drawer” to Runtime’s “ECSEntity” component.
• From Plugins to both Editor and Runtime to reflect configuration influence.
• From Runtime’s “HTTP Server” to the Web-based documentation or explorer.