예제 #1
0
 public void StartNewButton()
 {
     if (PlayerPrefs.HasKey("LEVEL"))
     {
         panel.SetActive(true);
         playButton.onClick.AddListener(playPressed);
         backButton.onClick.AddListener(backPressed);
     }
     else
     {
         transition.load("Level_0");
         PlayerPrefs.SetInt("LEVEL", 0);
         PlayerPrefs.SetInt("PUZZLE", 0);
     }
 }
예제 #2
0
    IEnumerator StartDialogue()
    {
        yield return(new WaitForSeconds(0.1f));

        disablePlayers();
        yield return(new WaitForSeconds(0.5f));

        walkTowards = true;
        yield return(new WaitForSeconds(1f));

        yield return(new WaitUntil(() => !walkTowards));

        if (player_0_Function.transform.localScale.x > 0)
        {
            Flip0();
        }
        yield return(new WaitForSeconds(1f));

        BaseDialogue.scriptList = CharacterScript;
        BaseDialogue.charName   = CharacterName;
        baseDialogue.startDialogue();
        yield return(new WaitUntil(() => BaseDialogue.dialogueEnd));

        Flip0();
        transition.load("HubWorld");
    }
예제 #3
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        Debug.Log(PlayerPrefs.GetInt("LEVEL"));
        int level = PlayerPrefs.GetInt("LEVEL") + 1;

        Debug.Log(level);
        transition.load("Level_" + level);
    }
예제 #4
0
    IEnumerator StartCutScene()
    {
        player_1.SetInteger("Animate", 0);
        yield return(new WaitForSeconds(0.5f));

        disablePlayers();
        yield return(new WaitForSeconds(1f));

        walkTowards = true;
        yield return(new WaitForSeconds(1f));

        yield return(new WaitUntil(() => !walkTowards));

        Flip0();
        Flip1();

        yield return(new WaitForSeconds(1f));

        BaseDialogue.scriptList = DialogueScripts.TutorialCS3P1;
        BaseDialogue.charName   = DialogueScripts.TutorialCS3NameP1;
        baseDialogue.startDialogue();
        yield return(new WaitUntil(() => BaseDialogue.dialogueEnd));

        disablePlayers();
        yield return(new WaitForSeconds(0.5f));

        walkPuzzle = true;
        yield return(new WaitForSeconds(1f));

        yield return(new WaitUntil(() => !walkPuzzle));

        Destroy(puzzle.gameObject);
        PlayerPrefs.SetInt("PUZZLE", 1);
        walkBack = true;
        yield return(new WaitUntil(() => !walkBack));

        Flip0();
        yield return(new WaitForSeconds(1f));

        BaseDialogue.scriptList = DialogueScripts.TutorialCS3P2;
        BaseDialogue.charName   = DialogueScripts.TutorialCS3NameP2;
        baseDialogue.startDialogue();

        yield return(new WaitUntil(() => BaseDialogue.dialogueEnd));

        disablePlayers();
        Eden = true;
        yield return(new WaitUntil(() => !Eden));

        p1.enabled = false;
        Grant      = true;
        yield return(new WaitUntil(() => !Grant));

        p0.enabled = false;
        yield return(new WaitForSeconds(1f));

        transition.load("HubWorld");
    }
예제 #5
0
 public void Resume()
 {
     if (PlayerPrefs.HasKey("LEVEL"))
     {
         transition.load("Level_" + PlayerPrefs.GetInt("LEVEL"));
     }
     else
     {
         Debug.Log("EMPTY!!!");
     }
 }
예제 #6
0
 private void WaitF()
 {
     if (exit)
     {
         CancelInvoke("WaitF");
     }
     else
     {
         if (Input.GetKeyDown(KeyCode.F) && TutorialExitScript.dialogueEnd)
         {
             transition.load("Level_" + num);
         }
     }
 }
예제 #7
0
    IEnumerator StartDialogue()
    {
        yield return(new WaitForSeconds(1f));

        p0.SetFloat("Speed", 0);
        p1.SetFloat("Speed", 0);
        BaseDialogue.scriptList = script;
        BaseDialogue.charName   = names;
        baseDialogue.startDialogue();
        yield return(new WaitUntil(() => BaseDialogue.dialogueEnd));

        yield return(new WaitForSeconds(1f));

        transition.load("HubWorld");
    }
예제 #8
0
 public void Restart()
 {
     pause.UnPause();
     p0.EnableMovement();
     transition.load(SceneManager.GetActiveScene().name);
 }
예제 #9
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        int level = PlayerPrefs.GetInt("LEVEL") + 1;

        transition.load("Level_" + level);
    }
예제 #10
0
    IEnumerator FadeIn()
    {
        yield return(new WaitUntil(() => dialogue.next));

        dialogue_Canvas.enabled = false;
        fadeSpeed = 0.0005f;
        fade      = true;
        yield return(new WaitUntil(() => alpha <= 0.9f));

        fade       = false;
        tut_string = tut_list[dNum];
        ContinueDialogue();
        dNum++;

        yield return(new WaitUntil(() => dialogue.next));

        dialogue_Canvas.enabled = false;
        fadeBlack = true;
        yield return(new WaitUntil(() => alpha >= 0.95f));

        yield return(new WaitForSeconds(2f));

        fadeBlack = false;
        fadeSpeed = 0.001f;
        fade      = true;
        yield return(new WaitUntil(() => alpha <= 0.75f));

        fade = false;
        yield return(new WaitForSeconds(1f));

        tut_string = tut_list[dNum];
        ContinueDialogue();

        yield return(new WaitUntil(() => dialogue.next));

        dialogue_Canvas.enabled = false;
        fadeSpeed = 0.01f;
        fade      = true;

        yield return(new WaitUntil(() => alpha <= 0.1f));

        fade          = false;
        black.enabled = false;
        List <string[]> optional = new List <string[]>();

        optional = DialogueScripts.TutorialCS1OptionalQ;
        choice   = true;
        for (int i = 0; i < 3; i++)
        {
            tut_string = optional[i];
            ContinueDialogue();
            yield return(new WaitUntil(() => !dialogue.isTyping));

            choice1.enabled = true;
            choice1.text    = DialogueScripts.TutorialCS1Optional1[i];
            choice2.enabled = true;
            choice2.text    = DialogueScripts.TutorialCS1Optional2[i];
            yield return(new WaitUntil(() => (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Alpha2))));

            choice1.enabled = false;
            choice2.enabled = false;
            if (Dialogue.choiceNumber == 2)
            {
                break;
            }
            else if (i == 2)
            {
                transition.load("Menu_Scene");
            }
        }
        dialogue_Canvas.enabled = false;

        yield return(new WaitForSeconds(1f));

        player_0_Function.transform.Translate(Vector3.up * 1f, Space.World);
        player_0_Function.transform.rotation = Quaternion.Euler(0, 0, 0);
        yield return(new WaitForSeconds(1f));

        Vector2 localScale = player_0_Function.transform.localScale;

        localScale.x *= -1;
        player_0_Function.transform.localScale = localScale;
        yield return(new WaitForSeconds(0.75f));

        localScale.x *= -1;
        player_0_Function.transform.localScale = localScale;
        yield return(new WaitForSeconds(0.75f));

        localScale.x *= -1;
        player_0_Function.transform.localScale = localScale;
        yield return(new WaitForSeconds(0.75f));

        BaseDialogue.scriptList = DialogueScripts.TutorialCS2;
        BaseDialogue.charName   = DialogueScripts.TutorialCS2Name;
        baseDialogue.startDialogue();
        yield return(new WaitUntil(() => BaseDialogue.dialogueEnd));

        dialogueEnd   = true;
        localScale.x *= -1;
        player_0_Function.transform.localScale = localScale;

        player_0_Function.enabled = true;
        player_1_Function.enabled = true;

        PlayerPrefs.SetString("TUTORIAL", "DONE");
    }