- Home /
Plugin return valid string value first time
DllImport("SimplePlugin")]
private static extern string mainSort();
[DllImport("SimplePlugin")]
private static extern string testString();
Debug.Log(testString());
Debug.Log(mainSort());
I wrote a C++ plugin contains a very complicated function mainSort() and return a string while testString() is just return a "Hello" string. When I run it in Unity, the C# script get a valid return value first time while after the first time it works good, and if I change the return value into other type it works good too. And further more, if I call the testString() function before the mainSort() both function work perfectly, so I am totally confused about the reason. Any one meet this problem before? Or any solutions?
Your answer
Follow this Question
Related Questions
Replace the first string C# 1 Answer
How to pass string to a unity plugin? 2 Answers
using unity string plugin webcam 1 Answer
Can't return a string after value is true in coroutine 1 Answer
Android Plugin return values non-string 0 Answers