RobotecAI / ros2-for-unity

High-performance ROS2 solution for Unity3D
Apache License 2.0
446 stars 58 forks source link

Allow install of Ros2ForUnity asset in sub-directory #86

Open RobertoRoos opened 11 months ago

RobertoRoos commented 11 months ago

Is your feature request related to a problem? Please describe.

I would like to install the asset in a subdirectory, e.g. Assets/Externa/Ros2ForUnity. This way I can organize not self-made assets in one place.

Describe the solution you'd like

Currently this would result in a runtime error, because the accompanying xml files are then not found. The asset path is hardcoded.

I know little of Unity, but I imagine there is some path tools to provide the current script path, from which other resources could be located. That seems more robust.

Describe alternatives you've considered NaN

Additional context NaN

RobertoRoos commented 11 months ago

Even better: I guess this plugin should be a Package, instead of a folder under Assets.

I experimented with this one: https://github.com/RobertoRoos/ROS2-for-Unity-Package I committed the v1.3.0 Windows standalone build, with a package.json and some other changes to hard-coded paths. You can now simply refer to this Git repository with the Unity package manager and it should work.

Of course Git is not really suited for binary releases like this, but the archives uploaded here could be for a package instead, making them more modular compared to a set of assets. The Unity package manager can also install from a downloaded archive.

Thoughts?

RobertoRoos commented 11 months ago

I made a new branch on my fork for packaging: https://github.com/RobertoRoos/ros2-for-unity/tree/feature/package

This version uses paths that work for a package directory and contains the necessary json and asmdef files. I tried to adapt the build scripts such that the procedure is the same, but I'm not sure they work as they should.