我统一实施了适用于 Android 的 Soomla inn 应用程序购买,它工作正常,但是当购买成功完成时我的分数没有更新。我为购买设置了“android.test.purchased”。这是我的代码
void Start ()
{
PlayerPrefs.SetInt("Score" ,0)
}
void CheckIAP_PurchaseStatus()
{
//What I do here ????? below check not working for me
if (StoreInventory.IsVirtualGoodEquipped ("coinspack_a_item_id"))
{
PlayerPrefs.SetInt("Score" , PlayerPrefs.GetInt("Score") + 8000);
}}
void OnGUI ()
{
if (GUI.Button(new Rect(10, 10, 50, 50), "Buy"))
{
try {
StoreInventory.BuyItem ("coinspack_a_item_id");
}
catch (Exception e)
{
Debug.Log ("SOOMLA/UNITY" + e.Message);
}
}
}