Skip to content

Unity Hybrid extension to Leopotam Entity Component System Framework

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

GutterLab/leoecshybrid

 
 

Repository files navigation

Leopotam ECS Hybrid

This is the Unity Hybrid extension to Leopotam Entity Component System Framework.
Hybrid ECS let you to connect scenes and prefabs of Unity with ECS in easy way. It's working like Unity.Entities.Hybrid.

You need to install LeoECS and LeoECS Unity Integration to proper work.

Installation as unity module

This repository can be installed as unity module directly from git url. In this way new line should be added to Packages/manifest.json:

"com.leopotam.ecs-hybrid": "https://github.com/SH42913/leoecshybrid.git",

By default last released version will be used. If you need trunk / developing version then develop name of branch should be added after hash:

"com.leopotam.ecs-hybrid": "https://github.com/SH42913/leoecshybrid.git#develop",

Content

  • HybridEntity to represent Entity on scene/prefab.
  • ECS One Frame Component NewHybridEntityEvent to let you know about any new HybridEntity.
  • ComponentWrapper to add/remove ECS components to HybridEntity. You also can override some methods.
  • Inspector to ComponentWrapper. It will warning you when something went wrong.
  • Interface ICanCopyData.
    It's mandatory interface to component in ComponentWrapper, you need to copy every field to other instance to proper work.
  • ECS Component UnityObject to let you refer to GameObject of HybridEntity.
  • ECS Component Updated<> to let you know when component changed from Inspector.
    You also can use it to reactive-like systems. Just make EcsFilter<Updated<Component>> and fire event with...
  • Entity Extension MarkAsUpdated<>. It will simply add Updated<> component to entity.
  • Abstract mono behaviour BaseStartup. You can inherit it to get simple interface for working in Unity. All ECS One Frame components will remove after lateUpdateSystems processing.
internal sealed class $STARTUP$ : BaseStartup 
{
    private void OnEnable() {
        CreateWorld();
        CreateSystems();
        
        //fixedUpdateSystems.Add(new FixedUpdateSystem());
        //updateSystems.Add(new UpdateSystem());
        //lateUpdateSystems.Add(new LateUpdateSystem());
        //gizmosSystems.Add(new GizmosSystem());

        //updateSystems.Inject(something);
        FinalizeSystems();
    }
}

I also very recommend to think "One startup - one scene" and to decompose your game to scenes!

About

Unity Hybrid extension to Leopotam Entity Component System Framework

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%