Ejemplo n.º 1
0
    /// <summary>
    /// Displays one letter in the WordGrid as a hint.
    /// </summary>
    public void DisplayNextHint()
    {
        if (CurrentHints == 0)
        {
            if (rewardedButton.IsAvailableToShow())
            {
                rewardedButton.OnClick();
            }
            else if (!rewardedButton.IsActionAvailable())
            {
                int remainTime = (int)(GameConfig.instance.rewardedVideoPeriod - CUtils.GetActionDeltaTime("rewarded_video"));
                Toast.instance.ShowMessage("Ad is not available now. Please wait " + remainTime + " seconds");
            }
            else
            {
                Toast.instance.ShowMessage("Ad is not available now. Please wait");
            }
        }
        else if (ActiveBoardState != null && CurrentHints > 0)
        {
            // Call DisplayNextHint in wordGrid, giving it the last hint index that was displayed. DisplayNextHint will return the word and letter that was displayed
            int  hintWordIndex;
            int  hintLetterIndex;
            bool hintDisplayed = wordGrid.DisplayNextHint(ref ActiveBoardState.nextHintIndex, out hintWordIndex, out hintLetterIndex);

            // Check if a hint was actually displayed
            if (hintDisplayed)
            {
                // Decrement the amount of hints
                CurrentHints--;

                // Update the board state so we know what letters where shown because of hints (so if the board is loaded from save we can lpace the hint words)
                ActiveBoardState.hintLettersShown.Add(new int[] { hintWordIndex, hintLetterIndex });

                // Save the game
                Save();
            }
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Displays one letter in the WordGrid as a hint.
    /// </summary>
    public void DisplayNextHint()
    {
        if (ActiveBoardState != null && CurrentHints > 0)
        {
            // Call DisplayNextHint in wordGrid, giving it the last hint index that was displayed. DisplayNextHint will return the word and letter that was displayed
            int  hintWordIndex;
            int  hintLetterIndex;
            bool hintDisplayed = wordGrid.DisplayNextHint(ref ActiveBoardState.nextHintIndex, out hintWordIndex, out hintLetterIndex);

            // Check if a hint was actually displayed
            if (hintDisplayed)
            {
                // Decrement the amount of hints
                CurrentHints--;

                // Update the board state so we know what letters where shown because of hints (so if the board is loaded from save we can lpace the hint words)
                ActiveBoardState.hintLettersShown.Add(new int[] { hintWordIndex, hintLetterIndex });

                // Save the game
                Save();
            }
        }
    }