namespace GameSmart {
public class User : API {
[DllImport("__Internal")]
public static extern void IsGuestUser(string objectName, string objectMethodName);
public static void IsGuest(string objectName, string objectMethodName) {
IsGuestUser(objectName, objectMethodName);
}
}
}
And is initiated like so:
public class Test : MonoBehaviour {
void Start() {
GameSmart.User.IsGuest("GameSmart", "OnIsGuest");
}
}
As seen above I pass GameSmart and OnIsGuest to the JavaScript, and when it gets to the JavaScript I call Pointer_stringify() on both of the values.
When converted and logged, I get the following output: 0Zހ and ﳀ� I should have gotten GameSmart and OnIsGuest back but I didn’t what is causing this to happen?
Execute: function (action, objectName, objectMethodName) {
var args = [];
// Convert "arguments" to an array
for (var i = 0; i < arguments.length; i++) { args.push(arguments[i]) }
// Remove the first 3 items: "action", "objectName", "objectMethodName"
// This will leave us with the methods arguments from params string[] args
args.splice(0, 3);
for (var i = 0; i < args.length; i++) {
args[i] = Pointer_stringify(args[i]);
}
switch (jsAction) {
case 'StoreCategoryItems':
gamesmart.store.categoryItems({ category: args[0] }, function (result) {
gameSmartGameInstance.SendMessage(jsObjectName, jsObjectMethodName, JSON.stringify(result));
})
break;
}
}
Is there a way for me to get those arguments passed in? because once converted, they also are garbled the same way as in the original post.