Quantcast
Channel: Questions in topic: "dll"
Viewing all articles
Browse latest Browse all 706

Why are Vector2 parameters of methods , set to be = new Vector2 , read as being null by dll ?

$
0
0
I started getting this error as soon as i make my code into a dll. `Argument #' cannot convert null' expression to type UnityEngine.Vector2'` I did not tget this error when my code was just a c# script. **Okay here is a before and after synopsis.** Initially I had a regular c# script named ScriptA in my unity project . This is ScriptA namespace MyScript { public class ScriptA { public void MethodA(Rect rect, int i, Vector2 position = new Vector2()) { } } } I then use ScriptA.MethodA , and as you see , the Vector2 parameter is marked as `= new Vector2()` .awesome. ![alt text][1] I then moved ScriptA to a Class Library and made a dll out of it . Place the dll into my unity project. it wors , the clases are accessed, However for some reason as you see in this picture the Vector2 parameter in MethodA sa marked as `= null` even though in the dll it is set to `= new Vector2` ![alt text][2] [1]: /storage/temp/55489-ne1.jpg [2]: /storage/temp/55488-ne15.jpg

Viewing all articles
Browse latest Browse all 706

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>