using Entitas;
public sealed class TestInitSystem : IInitializeSystem
{
private readonly Contexts contexts;
public TestInitSystem(Contexts contexts)
{
this.contexts = contexts;
}
public void Initialize()
{
contexts.game.CreateEntity();
}
}
TestFooFeature.cs
public sealed class TestFooFeature : Feature
{
public TestFooFeature(Contexts contexts)
{
Add(new TestInitSystem(contexts));
}
}
GameController.cs
using UnityEngine;
public class GameController : MonoBehaviour
{
private TestFooFeature testFooFeature;
void Start()
{
Contexts contexts = Contexts.sharedInstance;
testFooFeature = new TestFooFeature(contexts);
testFooFeature.Initialize();
}
private void Update()
{
testFooFeature.Execute();
}
}
After running
mono Jenny.exe gen
the generated code works fine in Unity. During playtime the entity got created by the init system.
When creating a new component
TestFooComponent.cs
using Entitas;
[Game]
public sealed class TestFooComponent : IComponent
{
public string value;
}
and regenerating the sources this component was not picked up by the Roslyn code generator. So first of all I can't add the component to the generated entity during playtime in the inspector
Next it's not possible for me to add this component to entities via code, so this can't be resolved
When I go to Tools => Jenny => Generate the sample works fine, so the component got picked up and I can add it via code.
When running the Roslyn code generator again, it will remove the picked up component, so the code can't be resolved anymore
When I check the generated folder there is a directory called "Components" but it's empty when using Roslyn. When using the default code generator the component exists in that directory.
What am I missing? I think it's a really stupid mistake but it's important to know so I can update the written guide in the Wiki.
It seems my Jenny.properties file is not correct. This is how I setup the Roslyn generator
It seems I found the problem. When I run mono Jenny/Jenny.exe the CLI dialog opens up.
I then choose "Use jenny.properties". Until now I selected everything and executed "Save and continue (auto import)". But this seems to be wrong. What should be selected?
Hi, I sticked to the LTS version and followed the guide I've written some days before (lol)
https://github.com/sschmid/Entitas-CSharp/wiki/How-to-setup-a-new-Github-project-with-Unity-and-tests
For testing purposes I created these files
TestInitSystem.cs
TestFooFeature.cs
GameController.cs
After running
the generated code works fine in Unity. During playtime the entity got created by the init system.
When creating a new component
TestFooComponent.cs
and regenerating the sources this component was not picked up by the Roslyn code generator. So first of all I can't add the component to the generated entity during playtime in the inspector
Next it's not possible for me to add this component to entities via code, so this can't be resolved
When I go to Tools => Jenny => Generate the sample works fine, so the component got picked up and I can add it via code. When running the Roslyn code generator again, it will remove the picked up component, so the code can't be resolved anymore
When I check the generated folder there is a directory called "Components" but it's empty when using Roslyn. When using the default code generator the component exists in that directory.
What am I missing? I think it's a really stupid mistake but it's important to know so I can update the written guide in the Wiki.
It seems my Jenny.properties file is not correct. This is how I setup the Roslyn generator
https://github.com/sschmid/Entitas-CSharp/wiki/How-to-setup-a-new-Github-project-with-Unity-and-tests#optional-setting-up-the-roslyn-code-generator
And finally these are my properties
I think it should be this
but my file is lacking "Roslyn".
It seems I found the problem. When I run
mono Jenny/Jenny.exe
the CLI dialog opens up.I then choose "Use jenny.properties". Until now I selected everything and executed "Save and continue (auto import)". But this seems to be wrong. What should be selected?