Doraku / DefaultEcs

Entity Component System framework aiming for syntax and usage simplicity with maximum performance for game development.
MIT No Attribution
658 stars 62 forks source link

how to use in unity #109

Closed 313364973 closed 3 years ago

313364973 commented 3 years ago

i copy dll to unity plugins folder , error happend System.Memory is the misssing with the current plattform

313364973 commented 3 years ago

I use nut for unity error happend Assembly references: 4.0.2.0 Found in project :4.0.3.0

Doraku commented 3 years ago

Hey, sadly unity does not handle nuget directly for now so I used this (NuGetForUnity) package to handle it. If you do it manually you would also need to add the dependencies of DefaultEcs (System.Buffers 4.5.1, System.Memory 4.5.4 and System.Runtime.CompilerServices.Unsafe 4.5.3). An other weird problem of unity is that some dependencies of DefaultEcs are already present but with a different version and unity does not have BindingRedirect like we have in dotnet application, so the solution was to disable "Validate References" on the DefaultEcs.dll and System.Memory.dll in the unity editor image I think this option is not present in older version of unity though :/ Maybe if there is enough interest I will directly create a unity package to ease this setup :)

313364973 commented 3 years ago

thanks a lot very helpful。

Doraku commented 3 years ago

Np, I added a faq with those informations since I can imagine others encountering the same problem. Don't hesitate if you have an other problem, I have only tested basic usage of DefaultEcs in Unity on Windows and Android :)