Example #1
0
    private void ConfirmRescueCallback(bool result)
    {
        if (result)
        {
            if (GameSystem.GetInstance().CheckIsActivated(ConfirmActiveGame, ActivateGameSucceed))
            {
                if (GameSystem.GetInstance().Coin >= rescuePrice)
                {
                    GameSystem.GetInstance().Coin -= rescuePrice;
                    GameSystem.GetInstance().CurrentModeLogic.Rescue();
                    GameSystem.GetInstance().ChangeState(GameSystem.States.GamePreview);
                    PlayerProfile.SaveCoin(GameSystem.GetInstance().Coin);

                    UMengManager.Buy(UMengManager.Item_IAP[(int)IAPManager.IAPProduct.Rescue], 1, rescuePrice);
                }
                else
                {
                    IAPManager.GetInstance().Pay(IAPManager.IAPProduct.Rescue);
                }
            }
        }
        else
        {
            entity.gameCore.StarWaveFailAnim();
        }
    }
Example #2
0
    public void UnlockMode(Mode mode)
    {
        if (GameSystem.GetInstance().Coin >= Constant.MODE_UNLOCK_COIN[(int)mode])
        {
            PlayerProfile.SaveModeUnlock(mode, true);
            GameSystem.GetInstance().Coin -= Constant.MODE_UNLOCK_COIN[(int)mode];
            PlayerProfile.SaveCoin(GameSystem.GetInstance().Coin);

            UMengManager.Buy(UMengManager.Item_Unlock_Mode[(int)mode], 1, Constant.MODE_UNLOCK_COIN[(int)mode]);
        }
    }