Esempio n. 1
0
    private void Update()
    {
        activateFreeze();
        freezePlayer();
        timerTime -= Time.deltaTime;
        timeStart -= Time.deltaTime;
        if (timeStart >= 0)
        {
            TimerText.text = Mathf.Round(timeStart).ToString();
        }
        else
        {
            if (myhealthBar.value > enemyhealthBar.value)
            {
                Loader.SceneLoader(3);
            }
            else if (enemyhealthBar.value > myhealthBar.value)
            {
                Loader.SceneLoader(2);
            }
        }

        int tempTime = Int32.Parse(TimerText.text);

        if (timerTime <= 0)
        {
            botDamage();
            timerTime = damageInterval;
        }

        // Enemy wins =============================================
        if (myhealthBar.value == 0 && !chun_test.victory)
        {
            Loader.SceneLoader(2);
            myhealthBar.value          = 100;
            enemyhealthBar.value       = 100;
            timeStart                  = 60;
            commonWordScore.scoreValue = 100;
        }

        // Player wins =============================================
        if (enemyhealthBar.value == 0 && !ken_test.victory)
        {
            Loader.SceneLoader(3);
            myhealthBar.value          = 100;
            enemyhealthBar.value       = 100;
            timeStart                  = 60;
            commonWordScore.scoreValue = 100;
        }
    }
Esempio n. 2
0
 void OnMouseOver()
 {
     if (Input.GetMouseButtonUp(0))
     {
         LoadScene.SceneLoader(1);
     }
 }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        if (Time.time - startTime >= Step)
        {
            Vector3 iconAngle = mainIconcycle.localEulerAngles;
            iconAngle.z += StepAngle;

            mainIconcycle.localEulerAngles = iconAngle;

            startTime = Time.time;
        }
        if (Time.time - timefornextscene > LOAD)
        {
            LoadNewScene.SceneLoader(2);
        }
    }
Esempio n. 4
0
 private void Update()
 {
     if (Input.anyKeyDown)
     {
         if (clickCount == 0)
         {
             clickCount++;
             gameObjectToAppear.SetActive(true);
             StartCoroutine(VideoManager.instance.PlayVideo(video));
         }
         else
         {
             LoadScene.SceneLoader(nextScene);
         }
     }
 }
Esempio n. 5
0
    public void ChangeContent()
    {
        GameObject InputFieldContent    = GameObject.Find(question_field[question_count]);
        string     CheckInputTextFilled = InputFieldContent.GetComponentInChildren <InputField>().text;

        if (CheckInputTextFilled != "")
        {
            foreach (PrefabBehavior item in button)
            {
                item.gameObject.SetActive(false);
            }
            question_count++;
            if (question_count == 1)//only the first change page need to show the building
            {
                CreateButton(BuildingName);
            }
            else if (question_count == 2)
            {
                //Debug.Log("it's the second time");
                //Debug.Log(trim);
                ChosenBuilding = CheckInputTextFilled.Replace(" ", "");
                CreatePage_BuildingFloor(ChosenBuilding);
                //  GameObject Input_ProblemTypeText = GameObject.Find(question_field[question_count]);
                // CreateButton_BuildingInfo(buildingname);
            }
            else if (question_count == 3)
            {
                //Debug.Log("it's the third time");
                CreateButton(AllBuildings.BuildingDetail[ChosenBuilding][CheckInputTextFilled.Replace(" ", "")]);
                //CreatePage_FloorLocation(ChosenBuilding, CheckInputTextFilled.Replace(" ",""));
            }
            else if (question_count == 4)
            {
                SceneLoader.SceneLoader(1);
            }
        }
        else
        {
            Debug.Log("You Need to Choose an Item.");
        }
    }
Esempio n. 6
0
    IEnumerator MenuOptionSceneChange()
    {
        yield return(new WaitForSeconds(0.3f));

        if (options[selectedOption].tag == "MenuOption")
        {
            sceneLoader.SceneLoader(0);
        }
        if (options[selectedOption].tag == "Level1NO")
        {
            if (conditionYES == false)
            {
                sceneLoader.SceneLoader(1);
            }
            else
            {
                sceneLoader.SceneLoader(2);
            }
        }
        // if (options[selectedOption].tag == "Level1YES") {
        //     sceneLoader.SceneLoader(2);
        // }
        if (options[selectedOption].tag == "Level2NO")
        {
            if (conditionYES == false)
            {
                sceneLoader.SceneLoader(3);
            }
            else
            {
                sceneLoader.SceneLoader(4);
            }
        }
        if (options[selectedOption].tag == "Level3NO")
        {
            if (conditionYES == false)
            {
                sceneLoader.SceneLoader(5);
            }
            else
            {
                sceneLoader.SceneLoader(6);
            }
        }
        if (options[selectedOption].tag == "Level4NO")
        {
            if (conditionYES == false)
            {
                sceneLoader.SceneLoader(7);
            }
            else
            {
                sceneLoader.SceneLoader(8);
            }
        }
        if (options[selectedOption].tag == "Level5NO")
        {
            if (conditionYES == false)
            {
                sceneLoader.SceneLoader(9);
            }
            else
            {
                sceneLoader.SceneLoader(10);
            }
        }
        // if (options[selectedOption].tag == "Level2YES") {
        //     sceneLoader.SceneLoader(4);
        // }
        else if (options[selectedOption].tag == "QuitOption")
        {
            sceneLoader.doExitGame();
        }
        else if (options[selectedOption].tag == "ResumeOption")
        {
            sceneLoader.ToggleMenu();
            // gameObject.SetActive(false);
        }
        else if (options[selectedOption].tag == "RestartOption")
        {
            sceneLoader.SceneLoader(sceneLoader.currentScene);
        }

        // if (options[selectedOption].tag == "StartOption") {
        //     sceneLoader.SceneLoader(6);
        // }
        // else if (options[selectedOption].tag == "MainMenuOption") {
        //     sceneLoader.SceneLoader(0);
        // }
        // else if (options[selectedOption].tag == "PlayerMvmtOption") {
        //     sceneLoader.SceneLoader(1);
        // }
        // else if (options[selectedOption].tag == "HomeGoalOption") {
        //     sceneLoader.SceneLoader(2);
        // }
        // else if (options[selectedOption].tag == "AvoidHazardsOption") {
        //     sceneLoader.SceneLoader(3);
        // }
        // else if (options[selectedOption].tag == "HazardsNearOption") {
        //     sceneLoader.SceneLoader(4);
        // }
        // else if (options[selectedOption].tag == "CandleOption") {
        //     sceneLoader.SceneLoader(5);
        // }
        // else if (options[selectedOption].tag == "QuitOption") {
        //     sceneLoader.doExitGame();
        // }
        // else if (options[selectedOption].tag == "SettingsOption") {
        //     sceneLoader.SceneLoader(7);
        // }
        // else if (options[selectedOption].tag == "CreditsOption") {
        //     sceneLoader.SceneLoader(8);
        // }
        // else if (options[selectedOption].tag == "EasyDifficulty") {
        //     difficultyText.text = "Easy";
        //     difficultyText.color = easyColor;
        //     levelDifficulty = "Easy";
        // }
        // else if (options[selectedOption].tag == "MediumDifficulty") {
        //     difficultyText.text = "Normal";
        //     difficultyText.color = normalColor;
        //     levelDifficulty = "Medium";
        // }
        // else if (options[selectedOption].tag == "HardDifficulty") {
        //     difficultyText.text = "Hard";
        //     difficultyText.color = hardColor;
        //     levelDifficulty = "Hard";
        // }
        controlEnabled = true;
        options[selectedOption].color = selectedColor;
    }
Esempio n. 7
0
 public void Click()
 {
     currentPot = potNumber;
     LoadScene.SceneLoader("Ligando atomos");
 }
Esempio n. 8
0
    IEnumerator ChangeScene()
    {
        yield return(new WaitForSeconds(2));

        _sceneLoader.SceneLoader("GameOver");
    }
Esempio n. 9
0
 public void FimQuadrinho()
 {
     LoadScene.SceneLoader("Lousa");
 }
Esempio n. 10
0
 /// <summary>
 /// Envia a resposta para a scene dos balões e vai para ela
 /// </summary>
 public void MandarResposta()
 {
     Pot.PutOnPot(moleculaAtual, Pot.currentPot);
     LoadScene.SceneLoader("Encher Balões");
 }
Esempio n. 11
0
    IEnumerator MenuOptionSceneChange()
    {
        yield return(new WaitForSeconds(0.3f));

        if (options[selectedOption].tag == "StartOption")
        {
            sceneLoader.SceneLoader(6);
        }
        else if (options[selectedOption].tag == "MainMenuOption")
        {
            sceneLoader.SceneLoader(0);
        }
        else if (options[selectedOption].tag == "PlayerMvmtOption")
        {
            sceneLoader.SceneLoader(1);
        }
        else if (options[selectedOption].tag == "HomeGoalOption")
        {
            sceneLoader.SceneLoader(2);
        }
        else if (options[selectedOption].tag == "AvoidHazardsOption")
        {
            sceneLoader.SceneLoader(3);
        }
        else if (options[selectedOption].tag == "HazardsNearOption")
        {
            sceneLoader.SceneLoader(4);
        }
        else if (options[selectedOption].tag == "CandleOption")
        {
            sceneLoader.SceneLoader(5);
        }
        else if (options[selectedOption].tag == "QuitOption")
        {
            sceneLoader.doExitGame();
        }
        else if (options[selectedOption].tag == "SettingsOption")
        {
            sceneLoader.SceneLoader(7);
        }
        else if (options[selectedOption].tag == "CreditsOption")
        {
            sceneLoader.SceneLoader(8);
        }
        else if (options[selectedOption].tag == "EasyDifficulty")
        {
            difficultyText.text  = "Easy";
            difficultyText.color = easyColor;
            levelDifficulty      = "Easy";
        }
        else if (options[selectedOption].tag == "MediumDifficulty")
        {
            difficultyText.text  = "Normal";
            difficultyText.color = normalColor;
            levelDifficulty      = "Medium";
        }
        else if (options[selectedOption].tag == "HardDifficulty")
        {
            difficultyText.text  = "Hard";
            difficultyText.color = hardColor;
            levelDifficulty      = "Hard";
        }
        controlEnabled = true;
        options[selectedOption].color = selectedColor;
    }