Git Product home page Git Product logo

Comments (5)

sschmid avatar sschmid commented on April 28, 2024

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.

StephenAArredondo avatar StephenAArredondo commented on April 28, 2024

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.

sschmid avatar sschmid commented on April 28, 2024

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
Screenshot

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.

StephenAArredondo avatar StephenAArredondo commented on April 28, 2024

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.

sschmid avatar sschmid commented on April 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.