我的iOS应用程序出现问题:触摸“购买”按钮购买IAP产品时,将出现一个弹出窗口,显示以下消息:
此应用内购买已购买。它将免费恢复。
我以前从未出现过此弹出窗口,并且我的产品仅是非续订订阅,因此我想知道为什么在购买订阅时会出现此消息。
当我触摸确定以关闭此弹出窗口时,不会执行购买。
这是我的代码:
for transaction in transactions {
switch transaction.transactionState {
case SKPaymentTransactionState.Purchased, SKPaymentTransactionState.Restored:
print("Transaction completed successfully.")
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
transactionInProgress = false
// Sauvegarde le produit acheté
savePurchasedProduct(transaction.transactionDate!);
break
case SKPaymentTransactionState.Failed:
print("Transaction Failed");
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
transactionInProgress = false
break
default:
break
}
}
Run Code Online (Sandbox Code Playgroud) 我尝试解析文件中包含的JSON对象(在Haxe中),但它不起作用.当我尝试从类中的var解析JSON对象时,它运行得很好但是当JSON在文件中时并非如此,所以我尝试打开文件并将对象放入其中.
感谢帮助 !
我在Unity遇到问题:
我尽量让事件侦听器与委托,和我从教程的代码,但我有一个错误,当我尝试添加委托方法为其他类方法:"无法隐式转换类型void' toMetronome.OnTickEvent".
这是我与代表的班级:
public delegate void OnTickEvent();
public event OnTickEvent onTick;
IEnumerator coroutineMetronome() {
if (CustomTimer.manager.timerState) {
for (;;) {
nextTick += delay;
yield return new WaitForSeconds(nextTick - Time.time);
onTick(); // I call the delegate method here
}
}
}
Run Code Online (Sandbox Code Playgroud)
......那就是事件接收器类:
protected virtual void Start ()
{
manager = this as T;
Metronome.manager.onTick += OnSynchronization(); // Here is the bug line
}
protected void OnSynchronization() {
Debug.Log("coucou");
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助 !
大家好,我只是想在一个类中执行一个方法而且它不起作用.我得到了"未捕获的TypeError:undefined不是函数"错误.
我正在调用其他函数,它运行良好,所以我不明白.我试图更改名称而没有.
我认为Phaser存在问题我正在使用但我不知道......
Bomb.prototype.collisionBlocs = function() {
if (!this.hasBounced) {
this.bounce();
this.hasBounced = true;
}
}
Bomb.prototype.bounce = function() {
if (this.direction == 'UP') {
this.direction = 'DOWN';
}
else if (this.direction == 'RIGHT') {
this.direction = 'LEFT';
}
else if (this.direction == 'DOWN') {
this.direction = 'UP';
}
else if (this.direction == 'LEFT') {
this.direction = 'RIGHT';
}
}
Run Code Online (Sandbox Code Playgroud)