Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (postSave && Time.frameCount == frameCount + 10)
     {
         print("posting");
         LoadingScreen loadingScreen = FindObjectOfType(typeof(LoadingScreen)) as LoadingScreen;
         APIActions.postSave();
         System.Threading.Thread.Sleep(1000);
         loadingScreen.show = false;
         postSave           = false;
     }
 }
Beispiel #2
0
    void Death()
    {
        isDead = true;
        print("DEAD ggez");

        nextLevel      = 1;
        currentHealth  = defaultHealth;
        currentSpeed   = defaultSpeed;
        currentDamage  = defaultDamage;
        currentDefense = defaultDefense;
        APIActions.postSave();

        SceneManager.LoadScene("GameOver");
    }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (GENSTAGE && Time.frameCount == frameCount + 30)
        {
            print("Generating...");

            try {
                Player player = FindObjectOfType(typeof(Player)) as Player;
                if (SceneManager.GetActiveScene().name == "HUBWorld")
                {
                    fromHub = true;
                }
                else
                {
                    player.nextLevel += 1;
                }
                ReturnObject result = APIActions.postSave();
                bool         status = result.retStatus;
                popupText = result.text;

                if (status == false)
                {
                    showPopup = true;
                }
            } catch (Exception ex) {
                print(ex);
            }

            LoadingScreen loadingScreen = FindObjectOfType(typeof(LoadingScreen)) as LoadingScreen;
            loadingScreen.show = true;

            Time.timeScale = 0;

            //SceneManager.LoadScene("Ana'esNEWLevel");

            GENSTAGE   = false;
            LOADSTAGE  = true;
            frameCount = Time.frameCount;
        }
        if (LOADSTAGE && Time.frameCount == frameCount + 30)
        {
            SceneManager.LoadScene("Ana'esNEWLevel");
            LOADSTAGE  = false;
            GENPLAYER  = true;
            frameCount = Time.frameCount;
        }
        if (GENPLAYER && Time.frameCount == frameCount + 30)
        {
            print("player time...");
            Instantiate(prePlayer);

            ui = GameObject.Find("HUDCanvas");
            ui.SetActive(false);

            GENPLAYER  = false;
            SETSTAGE   = true;
            frameCount = Time.frameCount;
        }
        if (SETSTAGE && Time.frameCount == frameCount + 30)
        {
            print("Setting...");
            Player player = FindObjectOfType(typeof(Player)) as Player;
            if (player.nextLevel == 1 && !fromHub)
            {
                SceneManager.LoadScene("HUBWorld");
            }
            else
            {
                stageHeight = player.nextLevel + 1;
                stageWidth  = player.nextLevel + 1;
                print("Width " + stageWidth + " Hight " + stageHeight);

                StageGeneratorScript stageGen = FindObjectOfType(typeof(StageGeneratorScript)) as StageGeneratorScript;
                stageGen.stageHeight = stageHeight;
                stageGen.stageWidth  = stageWidth;
                SETSTAGE             = false;
                stageGen.GenerateStage();
                fromHub = false;
                ui.SetActive(true);
            }

            LoadingScreen loadingScreen = FindObjectOfType(typeof(LoadingScreen)) as LoadingScreen;
            loadingScreen.show = false;
            //ui.SetActive (true);
            Time.timeScale = 1;
        }
    }