Пример #1
0
    // Play word!
    public void PlayWord()
    {
        BoxScript.PlayWord();
        //Debug.Log("Play word pressed.");

        // display the high score?
        //Debug.Log("Top score: " + DBManager.instance.topScore);
    }
Пример #2
0
    public void PlayButtonClick()
    {
        // increase number of interactions
        BoxScript.totalInteractions++;

        // Play sound
        AudioManager.instance.Play("Sparkle1");

        //=========FEATURE: Unproductive Juice=================================
        // CAMERA SHAKE when pressing button
        //=====================================================================
        if (GameManagerScript.juiceUnproductive)
        {
            CameraShaker.instance.ShakeOnce(3f, 4f, .1f, .6f);
        }

        //=========FEATURE: Productive Obstruction=============================
        // Display prompt if productive
        //=====================================================================
        if (GameManagerScript.obstructionProductive)
        {
            // get score
            long score = BoxScript.GetScore(BoxScript.currentWord, null);

            // get rarity
            float rarity = BoxScript.GetWordRank(BoxScript.currentWord);
            if (rarity < 0)
            {
                rarity = 0;
            }

            // update text
            promptText.text = "Are you sure you want to submit "
                              + BoxScript.currentWord + "?";
            rarityText.text = "Rarity: " + (rarity * 100).ToString("0.00") + "%";
            pointsText.text = "Points: " + score;

            submitPromptPanel.SetActive(true);

            // Turn on the timer for logging
            GameManagerScript.submitPromptOn = true;

            // Disable touch of the rest of the screen
            TouchInputHandler.inputEnabled = false;

            // Log the action
            LogPlayButtonClick(BoxScript.currentWord, rarity, score);
        }
        else
        {
            BoxScript.PlayWord();
        }
    }
Пример #3
0
    public void SubmitButtonClick()
    {
        // Play the currently selected word
        BoxScript.PlayWord();

        // Enable input to the rest of the screen
        TouchInputHandler.inputEnabled = true;

        // close window
        promptPanel.SetActive(false);

        ResetSubmitPromptTimer();
    }