Esempio n. 1
0
    //private Scene thisScene;

    void Start()
    {
        //scoreLabel = GameObject.Find ("ScoreLabel").GetComponent<Text> ();
        isDead      = false;
        reviewShown = false;
        //currentDanger = danger.None;
        currentState = State.Start;
        //dangerSpawner = GameObject.Find ("ShurikenSpawner").GetComponent<ShurikenSpawner> ();
        //peakNShoot = GameObject.Find("Peaknshoot").GetComponent<PeakNShoot>();
        player       = GameObject.Find("FingerTarget").GetComponent <Player>();
        multiplier   = GameObject.Find("FingerTarget").GetComponent <Multiplier>();
        waveManager  = GameObject.Find("WaveManager").GetComponent <WaveManager>();
        audioManager = GameObject.Find("AudioManager").GetComponent <AudioManager>();
        screenshot   = GetComponent <Screenshot>();
        panelManager = GameObject.Find("PanelManager").GetComponent <Panels>();
        //_nextDangerShot = _nextDangerResetValue;
        Load();
        panelManager.highscore = highscore;
        panelManager.CheckUnlockedPanels();
        adMultiplier = adMultiplierReset;
        //InitialReset();
        //thisScene = SceneManager.GetActiveScene();
    }
Esempio n. 2
0
    public void States()
    {
        switch (currentState)
        {
        case State.Reset:
            FullReset();
            ResetGame();
            break;

        case State.Holding:
            Holding();
            break;

        case State.Paused:
            pauseTimer -= Time.deltaTime;

            if (pauseTimer < 0)
            {
                currentState = State.Dead;
            }
            break;

        case State.Dead:
            //KillPlayer();
            if (score > highscore)
            {
                highscore = score;
                if (!gameIsSaved)
                {
                    Save();
                    gameIsSaved = true;
                }
                if (!reviewShown)
                {
                    panelManager.CheckUnlockedPanels();
                    RateBox.Instance.Show();
                    print("review shown");
                    reviewShown = true;
                }
                screenshot.highscore = true;
            }
            else
            {
                panelManager.CheckUnlockedPanels();
                screenshot.highscore = false;
                if (!gameIsSaved)
                {
                    Save();
                    adMultiplier--;
                    gameIsSaved = true;
                }
                if (adMultiplier <= 0)
                {
                    Advertisement.Show();
                    adMultiplier = adMultiplierReset;
                }
            }
            break;
        }
        //if (currentState == State.Active)
        //{
        //	switch (activeState)
        //	{
        //		case ActiveState.Reset:
        //			FullReset();
        //                  ResetGame();
        //			//activeState = ;
        //			break;
        //		case ActiveState.Holding:
        //			Holding();
        //			break;
        //		case ActiveState.Playing:
        //			//playing shit
        //			break;
        //		default:
        //			activeState = ActiveState.Reset;
        //			break;
        //	}
        //}
        //else if (currentState == State.Inactive)
        //{
        //if (activeState == ActiveState.Playing){
        //	inactiveState = InactiveState.Paused;
        //} else if (activeState == ActiveState.Dieing){
        //	inactiveState = InactiveState.Dead;
        //} else if (activeState == ActiveState.Continue){
        //	inactiveState = InactiveState.Continue;
        //}
        //switch (inactiveState)
        //{
        //case InactiveState.Start:
        //	break;
        //case InactiveState.Paused:
        //                pauseTimer -= Time.deltaTime;

        //                if (pauseTimer < 0)
        //                {
        //		inactiveState = InactiveState.Dead;
        //                }
        //                break;
        //case InactiveState.Ended:
        //	break;
        //case InactiveState.Screenshot:
        ////screenshot.TakeScreenshot();
        ////active- and inactive state are set back in screenshot.cs

        //               //activeState = ActiveState.Dieing;
        //               //inactiveState = InactiveState.Dead;
        //               break;
        //           case InactiveState.Dead:
        ////KillPlayer();
        //if (score > highscore)
        //{
        //	highscore = score;
        //	if (!gameIsSaved){
        //		Save();
        //		gameIsSaved = true;
        //                   }
        //	if (!reviewShown)
        //	{
        //		panelManager.CheckUnlockedPanels();
        //		RateBox.Instance.Show();
        //		print("review shown");
        //		reviewShown = true;
        //	}
        //	screenshot.highscore = true;
        //}
        //else
        //{
        //	panelManager.CheckUnlockedPanels();
        //	screenshot.highscore = false;
        //	if (!gameIsSaved)
        //                   {
        //                       Save();
        //		adMultiplier--;
        //                       gameIsSaved = true;
        //                   }
        //	if (adMultiplier <= 0)
        //                   {
        //                       Advertisement.Show();
        //                       adMultiplier = adMultiplierReset;
        //                   }
        //}
        //        break;
        //    default:
        //        break;
        //}
        //}
    }