Skip to content

martindevans/Myriad.ECS.Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Myriad.Unity.ECS

Integration for 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<TData> in the scene (most likely a GameTimeWorldHost)
  2. Create a new MonoBehaviour, extending WorldSystemGroup<TData>
  3. When the system group is enabled/disabled in the scene, it will be added/removed to the Myriad system list

Advanced Usage

  1. Create a new MonoBehaviour, extending BaseSimulationHost. This runs your Myriad simulation.
  2. Add MyriadEntityBindingSystem<TData> somewhere into your system schedule.
  3. Create a new simulation host editor:
[CustomEditor(typeof(SimulationHost))]
public class SimulationHostEditor
    : BaseSimulationHostEditor<SimulationHost, TData>
{
}
  1. 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.
  2. For every system you want to inspect, create a new system editor:
[MyriadSystemEditor(typeof(YourSystem))]
public class YourSystemEditor
    : IMyriadSystemEditor
{
    public void Draw<T>(ISystem<T> sys)
    {
        var system = (sys as YourSystem)!;
        EditorGUILayout.LabelField($"Myriad Is Cool");
    }
}

For every component you want to inspect, create a new component editor:

[MyriadComponentEditor(typeof(YourComponent))]
public class PagedRailEditor
    : IMyriadComponentEditor
{
    public void Draw(MyriadEntity entity)
    {
        var rail = entity.GetMyriadComponent<YourComponent>();
        EditorGUILayout.LabelField("Myriad Is Great");
    }
}

About

Unity integration for Myriad.ECS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages