Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martindevans/myriad.ecs.unity
Unity integration for Myriad.ECS
https://github.com/martindevans/myriad.ecs.unity
Last synced: 5 days ago
JSON representation
Unity integration for Myriad.ECS
- Host: GitHub
- URL: https://github.com/martindevans/myriad.ecs.unity
- Owner: martindevans
- Created: 2024-04-17T15:51:55.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-01-17T22:59:57.000Z (9 days ago)
- Last Synced: 2025-01-17T23:31:01.221Z (9 days ago)
- Language: C#
- Size: 4.49 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Myriad.Unity.ECS
Integration for [Myriad ECS](https://github.com/martindevans/Myriad.ECS) into Unity.
## Installation
Install in Unity package manager, git url: `[email protected]:martindevans/Myriad.ECS.Unity.git?path=/Packages/me.martindevans.myriad-unity-integration`
## Scene Driven Usage
1. Create a `WorldHost` in the scene (most likely a `GameTimeWorldHost`)
2. Create a new `MonoBehaviour`, extending `WorldSystemGroup`
3. When the system group is enabled/disable in the scene, it will be added/remove to the Myriad system list## Advanced Usage
1. Create a new MonoBehaviour, extending `BaseSimulationHost`. This runs your Myriad simulation.
2. Add `MyriadEntityBindingSystem` somewhere into your system schedule.
3. Create a new simulation host editor:```csharp
[CustomEditor(typeof(SimulationHost))]
public class SimulationHostEditor
: BaseSimulationHostEditor
{
}
```4. When you create an `Entity` which you want to bind to a GameObject, instantiate the GameObject with a `MyriadEntity` behaviour attached. Attach this behaviour to the `Entity`.
5. For every system you want to inspect, create a new system editor:```csharp
[MyriadSystemEditor(typeof(YourSystem))]
public class YourSystemEditor
: IMyriadSystemEditor
{
public void Draw(ISystem sys)
{
var system = (sys as YourSystem)!;
EditorGUILayout.LabelField($"Myriad Is Cool");
}
}
```For every component you want to inspect, create a new component editor:
```csharp
[MyriadComponentEditor(typeof(YourComponent))]
public class PagedRailEditor
: IMyriadComponentEditor
{
public void Draw(MyriadEntity entity)
{
var rail = entity.GetMyriadComponent();
EditorGUILayout.LabelField("Myriad Is Great");
}
}
```