Esempio n. 1
0
    private IEnumerator MyCoroutine(Loader.Scene scene)
    {
        SoundManager.PlaySound(SoundManager.Sound.ButtonClick);
        // yield return new WaitForSeconds(.15f);
        yield return(null);

        Loader.Load(scene);
    }
Esempio n. 2
0
 private void OnLoadScene(Loader.Scene scene)
 {
     if (anim)
     {
         anim.SetTrigger("crossfade");
     }
     else
     {
         Debug.Log("No animator found");
     }
 }
Esempio n. 3
0
    public void AfterScenario()
    {
        sceneToLoad      = sceneAfterScenario;
        Loader.ClockSkip = true;

        if (text.ToCharArray()[1] == "e".ToCharArray()[0])
        {
            sceneAfterScenario = Loader.Scene.CatchFruit;
        }

        Clock.GoingForward = true;
        loading            = true;
    }
Esempio n. 4
0
    public void LoadWorld()
    {
        string data = SaveSystem.Load(environementName);

        if (data != null)
        {
            saveObject = JsonUtility.FromJson <SaveData> (data);
            Loader.Scene currentScene = Loader.getCurrentScene();
            StartCoroutine(setEnv(saveObject.env));
            RessouceGenerator.listSavedRessource = saveObject.listRessource;
            InventoryPlayer.setSavedInventory(saveObject.inventoryPlayer);
            QuestManager.SetSavableData(saveObject.questPlayer);
        }
    }
Esempio n. 5
0
    IEnumerator GiveUpBehaviour()
    {
        //text = "That's right, give up.";
        //yield return StartCoroutine(TypeSentence());

        //TurnButtons(false);

        //yield return new WaitForSeconds(2f);
        yield return(null);

        sceneToLoad        = Loader.Scene.MainMenu;
        Clock.GoingForward = false;
        loading            = true;

        canClickButton = true;
    }
Esempio n. 6
0
    IEnumerator ContinueBehaviour()
    {
        //text = "Sure, go on. You will fail eventually.";
        //yield return StartCoroutine(TypeSentence());

        //TurnButtons(false);

        //yield return new WaitForSeconds(2f);
        yield return(null);

        string sceneName = SceneManager.GetActiveScene().name;

        switch (sceneName)
        {
        case "CatchFruit":
            sceneAfterScenario = Loader.Scene.CrossRoad;
            sceneToLoad        = Loader.Scene.ScenarioPrint;
            Clock.GoingForward = true;
            loading            = true;
            break;

        case "CrossRoad":
            sceneAfterScenario = Loader.Scene.OfficePacMan;
            sceneToLoad        = Loader.Scene.ScenarioPrint;
            Clock.GoingForward = true;
            loading            = true;
            break;

        case "OfficePacman":
            sceneAfterScenario = Loader.Scene.MainMenu;
            sceneToLoad        = Loader.Scene.ScenarioPrint;
            Clock.GoingForward = true;
            loading            = true;
            break;
        }

        canClickButton = true;
    }
Esempio n. 7
0
    IEnumerator TryAgainBehaviour()
    {
        canClickButton = false;

        //text = "You probably won't make it this time again.";
        //yield return StartCoroutine(TypeSentence());

        //TurnButtons(false);

        //yield return new WaitForSeconds(2f);
        yield return(null);

        string sceneName = SceneManager.GetActiveScene().name;

        switch (sceneName)
        {
        case "CatchFruit":
            sceneToLoad        = Loader.Scene.CatchFruit;
            Clock.GoingForward = false;
            loading            = true;
            break;

        case "CrossRoad":
            sceneToLoad        = Loader.Scene.CrossRoad;
            Clock.GoingForward = false;
            loading            = true;
            break;

        case "OfficePacman":
            sceneToLoad        = Loader.Scene.OfficePacMan;
            Clock.GoingForward = false;
            loading            = true;
            break;
        }

        canClickButton = true;
    }
Esempio n. 8
0
 public void LoadLevel(Loader.Scene scene)
 {
     Loader.loadScene(scene);
 }
Esempio n. 9
0
 public void GoToScene(Loader.Scene scene)
 {
     Loader.Load(Loader.Scene.GameScene);
 }