Skip to content

Releases: OctopBP/morpeh-source-generation

0.2.0

13 Jul 14:16
Compare
Choose a tag to compare

New filter

Now you can use generic filters. The first type or tuple defines with components, and an optional second type or tuple defines without components.

// Some examples
private Filter<Player> _anyPlayerFilter;
private Filter<Player, Disabled> _activePlayerFilter;
private Filter<(Player, Transform), Disabled> _playerWithTransformFilter;
private Filter<(Player, Transform), (Dead, Disabled)> _alivePlayerFilter;

Stash extensions

There are new extensions for Stashes generated for each component.
For marker components without fields, there is the SetOrRemove(Entity entity, bool setOrRemove) extension.

// Some examples
struct SomeComponent : IComponent {}

Stash<SomeComponent> _someStash;

var toggle = /*...*/;
_someStash.SetOrRemove(entity, toggle);

For components with fields, there is the new Set(Entity entity, /*...*/) extension. This allows you to assign values directly without creating a new structure.

// Some examples
struct SomeComponent : IComponent
{
    public int Value;
}

Stash<SomeComponent> _someStash;

_someStash.Set(entity, value: 10);

Register attribute

A new attribute can be added to a system field in a feature. This system will be registered in the DI container and can be injected into other systems.

public partial class SomeFeature : IFeature
{
    [Register] private readonly SomeServiceSystem _someServiceSystem;
}

0.1.2

06 Jul 11:44
Compare
Choose a tag to compare
  • Add WithWorld attribure to FeatureRunner

0.1.1

03 Jul 10:09
Compare
Choose a tag to compare
  • Remove async start

0.1.0

28 Mar 22:43
Compare
Choose a tag to compare
  • FeatureRenner generator (Constructor, Inject, Initialize, StartAsync, Tick, Dispose)
  • Feature methods generator (Constructor, Inject, Initialize, StartAsync, Tick, Dispose)
  • Systems Stashes and Filters Initialize and Dispose generator