- Home /
Is it possible to pass Array (containing class objects) from C# to C++ and add / edit objects from inside
I'm doing some testing / learning with basic SPH and it needs some optimization, so I want to test C++.
I created my particle objects and attached a parameter object to them. Then my "main object" has an array with those objects which are then looped and used in calculations.
When I pass single instances to c++ there is no problem. When I pass an array It crashes or returns wrong arrays.
I decided to try it with an array of structs. I can get the values but editing them makes unity crash.
I tried to pass arrays using [In,Out] and with pinned Intptr.
Structs/Classes contain float,int and vector3.
Also is it possible to pass a reference to an array and add structs to it from the c++ itself?
Could someone point me to some samples or documentation(with samples)?
With all the testing my code became a mess, so I want to start from scratch the right way.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Unable to use System.Numerics in Unity 2017 2 Answers
Flip over an object (smooth transition) 3 Answers
Using Native C++ dll in Unity 1 Answer