0
我有以下lib.jslib
文件Pointer_stringify將返回亂碼
mergeInto(LibraryManager.library, {
IsGuestUser: function (objectName, objectMethodName) {
gamesmart.user.isGuest(function (result) {
console.log(Pointer_stringify(objectName), Pointer_stringify(objectMethodName), result);
gameSmartGameInstance.SendMessage(Pointer_stringify(objectName), Pointer_stringify(objectMethodName), result);
});
}
});
後者從這裏稱爲:
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);
}
}
}
,並開始像這樣:
public class Test : MonoBehaviour {
void Start() {
GameSmart.User.IsGuest("GameSmart", "OnIsGuest");
}
}
正如所看到的上面我將GameSmart
和OnIsGuest
傳遞給JavaScript,並且當它到達我在這兩個值上調用了Pointer_stringify()
。
當轉換並記錄下來,我得到下面的輸出:0Zހ
和ﳀ�
我應該得到GameSmart
和OnIsGuest
回去,但我沒有什麼原因造成這種情況?