You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.
The current workflow for modifying the Rust client code is extremely cumbersome:
Close Unity.
Make changes to the mahjong-shared crate.
Run the build_shared script to build the DLL and update the C# bindings.
Re-open Unity.
This process has to be repeated each time a change is made in the Rust client code. In particular, the following problems make this workflow painful:
Having to re-open Unity each time a change is made slows the iteration cycle down massively.
Having to manually invoke the build script is less of a major issue, but it makes the Rust workflow relatively slow as compared to the C# workflow.
Currently, reloading Unity every time is necessary because Unity will not unload an unmanaged library once it has been loaded. This means that once you run the game in the editor and the DLL has been loaded, Unity won't be able to load the updated version.
Currently the DLL is loaded automatically via the [DllImport] attribute, however we could potentially try loading the library ourselves. That would allow us to manually unload the library when not in play mode, making it possible to update the library without having to restart Unity. Other people have written about taking a similar approach, so it should be possible.
Once we can update the DLL without reloading Unity, it should be relatively simple to use something like cargo-watch to automatically rebuild the DLL and bindings as the user edits the Rust code. This can be started from an editor script in the Unity project, that way we automatically start watch the project when the editor opens.
The text was updated successfully, but these errors were encountered:
The current workflow for modifying the Rust client code is extremely cumbersome:
build_shared
script to build the DLL and update the C# bindings.This process has to be repeated each time a change is made in the Rust client code. In particular, the following problems make this workflow painful:
Currently, reloading Unity every time is necessary because Unity will not unload an unmanaged library once it has been loaded. This means that once you run the game in the editor and the DLL has been loaded, Unity won't be able to load the updated version.
Currently the DLL is loaded automatically via the
[DllImport]
attribute, however we could potentially try loading the library ourselves. That would allow us to manually unload the library when not in play mode, making it possible to update the library without having to restart Unity. Other people have written about taking a similar approach, so it should be possible.Once we can update the DLL without reloading Unity, it should be relatively simple to use something like cargo-watch to automatically rebuild the DLL and bindings as the user edits the Rust code. This can be started from an editor script in the Unity project, that way we automatically start watch the project when the editor opens.
The text was updated successfully, but these errors were encountered: