예제 #1
0
    public static void UndoTurn()
    {
        if (State.gameActivity == GameActivity.play)
        {
            Identity.AddGems(-1);
        }

        SetBoardToTurn(seedsPlantedHistory.Count - 1);
    }
예제 #2
0
    public void GrantCredits(int credits)
    {
        Debug.Log(string.Format("ProcessPurchase: PASS. Gems: '{0}'", credits));

        int currentGems = Identity.GetGems();

        screen.SetGemCountDisplay(currentGems + credits);
        Identity.AddGems(credits);

        StoreResultText.text = "You successfully purchased " + credits.ToString() + " Gems!";
        ActorGameManager.ShowGroup(StoreResultPanelName, true);
    }
예제 #3
0
    public static void ShowHint()
    {
        if (State.gameActivity != GameActivity.play)
        {
            return;
        }

        Debug.Log("Show Hint Requested");

        if (seedsPlantedHistory.Count < State.gameBoard.seedsPlantedSolution.Count)
        {
            Identity.AddGems(-1);
            GameStep nextSolution = State.gameBoard.seedsPlantedSolution.ToArray()[seedsPlantedHistory.Count]; // get the solution 1 after the current step
            SetSeedColor(nextSolution.colorID);
            ActorGridManager.GetHexagonActor(nextSolution.hexagonID).PlantSeed();

            UpdateDisplay();
        }
        else
        {
            Debug.LogError("Hint requested past end of solution queue");
        }
    }
예제 #4
0
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    {
        Debug.LogWarningFormat("Recevied Purchase:{0}", args.purchasedProduct.definition.id);

        // A consumable product has been purchased by this user.
        if (String.Equals(args.purchasedProduct.definition.id, kProductIDConsumable1, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
            // The consumable item has been successfully purchased, add 100 coins to the player's in-game score.
            // ScoreManager.score += 100;
            int currentGems = Identity.GetGems();
            screen.SetGemCountDisplay(currentGems + 50);
            Identity.AddGems(50);
        }

        else if (String.Equals(args.purchasedProduct.definition.id, kProductIDConsumable2, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
            // The consumable item has been successfully purchased, add 100 coins to the player's in-game score.
            // ScoreManager.score += 100;
            int currentGems = Identity.GetGems();
            screen.SetGemCountDisplay(currentGems + 120);
            Identity.AddGems(120);
        }

        else if (String.Equals(args.purchasedProduct.definition.id, kProductIDConsumable3, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
            // The consumable item has been successfully purchased, add 100 coins to the player's in-game score.
            // ScoreManager.score += 100;
            int currentGems = Identity.GetGems();
            screen.SetGemCountDisplay(currentGems + 200);
            Identity.AddGems(200);
        }


        else if (String.Equals(args.purchasedProduct.definition.id, kProductIDConsumable4, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
            // The consumable item has been successfully purchased, add 100 coins to the player's in-game score.
            // ScoreManager.score += 100;
            int currentGems = Identity.GetGems();
            screen.SetGemCountDisplay(currentGems + 300);
            Identity.AddGems(300);
        }


        // Or ... a non-consumable product has been purchased by this user.
        else if (String.Equals(args.purchasedProduct.definition.id, kProductIDNonConsumable, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
            // TODO: The non-consumable item has been successfully purchased, grant this item to the player.
        }
        // Or ... a subscription product has been purchased by this user.
        else if (String.Equals(args.purchasedProduct.definition.id, kProductIDSubscription, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id));
            // TODO: The subscription item has been successfully purchased, grant this to the player.
        }
        // Or ... an unknown product has been purchased by this user. Fill in additional products here....
        else
        {
            Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
        }

        // Return a flag indicating whether this product has completely been received, or if the application needs
        // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
        // saving purchased products to the cloud, and when that save is delayed.
        return(PurchaseProcessingResult.Complete);
    }