Closed miroslavzeman closed 3 years ago
I'm sorry, I thought there are some helper methods generated as same as in Entitas, but the usage in tests, is different so there's probably no additional code generated because it's not required.
Closing this one. Sorry!
No, actually, I think this is a legitimate bug. Looking at the API and implementation for the code generators here, I see no reason that [EntityIndexGetMethod]
-marked methods shouldn't be used to generate extension methods for their associated Context
. I'm running into this issue as well; my custom indexes are being recognized by Genesis because they're being added to the generated Contexts.InitializeEntityIndices
method. However, the generated ContextsExtensions
class has suspicious gaps where the generated index extension methods should be.
@jeffcampbellmakesgames Would you be able to take a look at this? I suspect the issue is somewhere in EntityIndexGenerator
.
Specifically, I think this area is the best candidate:
The reason for that is that instead of extension methods for custom entity indexes, the relevant part of my generated Contexts.cs
file has more blank spaces than usual. Some string
is probably being replaced with whitespace, newlines, or string.Empty
behind your back.
I tried debugging it myself, but the local builds I'm using (due to pending PRs containing features I need) are complicating that process.
Describe the bug No code related to custom indexes is generated at all. The bug is probably related to previously reported bug with indexes not being generated.
Unity Version: Unity 2020.3.0f1
To Reproduce
Setup project as same as in previously reported bug
Create component
Generate
buttonGetExample()
method should be available inGame
context, but it's notExpected behavior Additional code should be generated for context to get entities by custom index.
Additional context Win 10, using Mono .NET 4.x in Unity player settings