Referencing Unity data structures in my external library
I am creating an external client/server application that has the ability to send custom protocol messages that are user-defined.
When using my library in Unity, I had to create a script in Unity that essentially wraps my send/receive functions to take in Unity data structures such as Vector3
, Quaternion
, etc.
I won't get into too many specifics, but on the backend I essentially just send the data across and make sure that the byte sizes all match up (among some other things).
I was wondering - is there a way to reference Unity data structures in my external application? This would be awesome, because it could support Unity as a standalone application instead of having to have a script in Unity that wraps the .dll functions and behavior for ease of use.
Example: currently for using Vector3
, I have a class in my external application called Float3
which I just use to transform data to and from Vector3
in Unity, like so:
public static Vector3 FromFloat3(Float3 f3)
{
return new Vector3(f3.x, f3.y, f3.z);
}
Its not the end of the world, but it would be much better to have this all built in to my application so I don't have to expose a Unity script...