Comments (5)
Hey Stephen, I haven't setup up a project to prove and reproduce yet, but my first thought was, it doesn't work because you're not using the Entitas sources, but a dll. Try using the source files, that should fix the conflicting types
from entitas.
Doing as you suggested, there are no further conflicts, but then I got another problem.
protected override void Initialize()
{
// TODO: Add initialization logic here
var newEntity = entityPool.CreateEntity();
newEntity.AddLight(3); // <-- Not working
newEntity.AddSprite(2, 32, 32); // <-- Not working
}
I no longer had the ability to call .Add($ComponentName) on the entity.
I played around with the namespaces a bit and realized that the Components cannot be declared within a namespace for this to work.
Originally
using Entitas;
namespace Components
{
public class LightComponent : IComponent
{
public float Direction;
}
}
Working
using Entitas;
public class LightComponent : IComponent
{
public float Direction;
}
With this, I'm good to go!
Thanks again for the help. I'll keep you posted. 👍
from entitas.
There shouldn't be a problem with namespaces. In my tests it's working fine. If you still have problems, let me know. In the email there was this screenshot attached
i saw this
newEntity.addLight(3)
with lowercase a. Maybe that's the problem. It's AddLight with uppercase A
I hope that helps
from entitas.
I noticed that too after I posted, but after correcting those line it was still not working.
I'll give it a shot at a later time. Working on embedding all of this with C# scripting at the moment. :D
from entitas.
Pool, Entity and Matcher are partial classes. If you use the code generator, which is adding functionality to the Pool, Entity and Matcher, you have to use the Entitas sources and not the dll.
Partial classes are a purely language feature. When an assembly is compiled, the files are combined to create the type. It isn't possible to spread the files out into different assemblies.
from entitas.
Related Issues (20)
- Unity crashes when clicking on a GameObject with Component of Entitas HOT 8
- Remove DesperateDevs dependencies
- [SOLVED] Unity 2022.3.4f1: Exceptions + broken inspector when looking at any entity HOT 16
- Add/Replace/Remove vs Set/Unset HOT 5
- Boolean in setttings for unique components to actually be unique
- A component with multiple contexts +events, only make event listeners for 1 context
- Could not resolve type with token ... expected class System.Threading.CancellationToken HOT 10
- How to generate codes in a project which has several csproj files? HOT 1
- Update on Entitas 2.0-beta and my situation HOT 3
- [1.14.1]code gen twice and compile error HOT 1
- there is a Error, on click Tools/Jenny/Gennerate, how can I do? HOT 4
- _group.GetEntities().AsParallel().ForAll(Execute);这段语句有GC HOT 2
- Is it feasible to use Entitas in the backend? HOT 7
- Entity Behaviour in Unity inspector not visible HOT 2
- Removal of crucial SearchPaths when executing the wiz command
- How to get all group in some context, without reflection。
- GUI Null ref when trying to view entity in inspector HOT 1
- generator issues HOT 1
- Error running dotnet Jenny/Jenny.Generator.Cli.dll gen -v command - System.IO.FileNotFoundException HOT 1
- Bro i want remove this how i remove
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entitas.