// Start game
    private void Start()
    {
        gameState = GameState.TALKING;

        player   = Instantiate(PFB_Player);
        boss     = Instantiate(PFB_Boss[SCR_Profile.bossSelecting]);
        security = Instantiate(PFB_Security[SCR_Profile.bossSelecting]);

        pnlResult.SetActive(false);
        btnReplay.SetActive(false);
        btnMainMenu.SetActive(false);
        imgNotice.SetActive(false);
        txtTutorial.SetActive(false);

        imgDanger.gameObject.SetActive(false);

        SCR_Pool.Flush();
        TriggerTutorial(TutorialStep.GRAB);
        SCR_LightBar.deltaCamera = 0;

        SCR_UnityAnalytics.StartGame();

        internalMoney = SCR_Profile.money;
        txtMoney.GetComponent <Text>().text = internalMoney.ToString();

        txtMoneyAddOriginalPosition  = txtMoneyAdd.GetComponent <RectTransform>().anchoredPosition;
        txtMoneyAddOriginalAnchorMin = txtMoneyAdd.GetComponent <RectTransform>().anchorMin;
        txtMoneyAddOriginalAnchorMax = txtMoneyAdd.GetComponent <RectTransform>().anchorMax;
        txtMoneyAddOriginalAlignment = txtMoneyAdd.GetComponent <Text>().alignment;
        txtMoneyAddOriginalFontSize  = txtMoneyAdd.GetComponent <Text>().fontSize;

        totalReward = 0;

        objectSpawnTime = Random.Range(OBJECT_SPAWN_TIME_MIN, OBJECT_SPAWN_TIME_MAX);
        dangerShowed    = false;
        dangerCounter   = 0;

        powerUpSpawnTime = Random.Range(POWER_UP_SPAWN_TIME_MIN, POWER_UP_SPAWN_TIME_MAX);

        shouldSelect = 0;

        securityProgress = 0;
        imgSecurityProgressFG.fillAmount = 0;

        imgSecurityProgressBG.gameObject.SetActive(false);
        imgSecurityProgressFG.gameObject.SetActive(false);

        firstPizza = true;
        firstDrone = true;
    }
    public void TriggerTutorial(TutorialStep step, bool force = false)
    {
        if (SCR_Profile.showTutorial == 1)
        {
            if (step == tutorialStep + 1 || force == true)
            {
                tutorialStep = step;


                if (step == TutorialStep.GRAB)
                {
                    tutorialAlpha = 1;
                    txtTutorial.SetActive(true);
                    txtTutorial.GetComponent <Text>().text = "Tap anywhere to start";
                    SCR_UnityAnalytics.StartTutorial();
                }
                else if (step == TutorialStep.THROW)
                {
                    txtTutorial.SetActive(false);
                }
                else if (step == TutorialStep.AIM)
                {
                    txtTutorial.SetActive(true);
                    txtTutorial.GetComponent <Text>().text = "Tap and hold to aim";
                }
                else if (step == TutorialStep.PUNCH)
                {
                    txtTutorial.SetActive(true);
                    txtTutorial.GetComponent <Text>().text = "Release to start punching";
                }
                else if (step == TutorialStep.FLY_UP)
                {
                    txtTutorial.GetComponent <Text>().text = "Keep on punching (0/3)";
                    Time.timeScale = 0.05f;
                }
                else if (step == TutorialStep.CONTINUE)
                {
                }
                else if (step == TutorialStep.FINISH)
                {
                    txtTutorial.GetComponent <Text>().text = "Well done!";
                    SCR_Profile.showTutorial = 0;
                    SCR_Profile.SaveProfile();

                    SCR_UnityAnalytics.FinishTutorial();
                }
            }
        }
    }
    public void Lose()
    {
        iTween.Stop(imgSecurityProgressFG.gameObject);
        imgSecurityProgressFG.GetComponent <SCR_SecurityProgress>().UpdateFlashAmount(0);

        imgSecurityProgressBG.gameObject.SetActive(false);
        imgSecurityProgressFG.gameObject.SetActive(false);

        pnlResult.SetActive(true);
        btnReplay.SetActive(true);
        btnMainMenu.SetActive(true);

        //txtResultTitle.text = boss.GetComponent<SCR_Boss>().resultTitle[SCR_Profile.bossSelecting];
        //txtResultTitle.fontSize = boss.GetComponent<SCR_Boss>().resultTitleFontSize[SCR_Profile.bossSelecting];

        const int FONT_MIN   = 80;
        const int FONT_MAX   = 155;
        const int LENGTH_MIN = 8;
        const int LENGTH_MAX = 16;

        txtResultTitle.text = SCR_Profile.bosses[SCR_Profile.bossSelecting].name;
        int l = txtResultTitle.text.Length;

        if (l < LENGTH_MIN)
        {
            l = LENGTH_MIN;
        }
        if (l > LENGTH_MAX)
        {
            l = LENGTH_MAX;
        }
        float r = 1 - (float)(l - LENGTH_MIN) / (LENGTH_MAX - LENGTH_MIN);

        txtResultTitle.fontSize = (int)(FONT_MIN + (FONT_MAX - FONT_MIN) * r);

        SCR_WaitMusic.FadeIn();
        SCR_PunchMusic.FadeOut();

        if (maxBossY > SCR_Profile.highScore)
        {
            imgHighScore.SetActive(true);
        }
        else
        {
            imgHighScore.SetActive(false);
        }

        SCR_Profile.ReportScore(maxBossY);
        txtPunchNumber.GetComponent <Text>().text  = maxCombo.ToString();
        txtHeightNumber.GetComponent <Text>().text = maxBossY.ToString();
        txtBestNumber.GetComponent <Text>().text   = SCR_Profile.highScore.ToString();

        int money = (int)(maxBossY * 0.5);

        AddMoney(money);

        txtMoneyNumber.GetComponent <Text>().text = "$" + totalReward.ToString();

        imgSecurityProgressBG.color = new Color(1, 1, 1, 0);
        imgSecurityProgressFG.color = new Color(1, 1, 1, 0);

        // -- //
        bool found = false;

        for (int i = 0; i < SCR_Profile.bosses.Length; i++)
        {
            if (SCR_Profile.bosses[i].unlocked == 0 && SCR_Profile.money >= SCR_Profile.bosses[i].cost)
            {
                if (SCR_Profile.bosses[i].recommended == 0)
                {
                    shouldSelect = i;
                    found        = true;
                    break;
                }
            }
        }

        if (found)
        {
            imgNotice.SetActive(true);
        }
        // -- //

        SCR_UnityAnalytics.FinishGame(maxBossY);
    }