コード例 #1
0
 // Update is called once per frame
 void Update()
 {
     if (showingDialogue)
     {
         if (!Dialogue.Instance.GetDialogueActive())
         {
             // after triggering dialogue, if dialogue isn't showing anymore, load
             LoadSceneLogic.Instance.LoadScene(SceneToLoad.GetSceneName());
         }
     }
 }
コード例 #2
0
ファイル: AreaExit.cs プロジェクト: xdaisy/osmose
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))
        {
            GameManager.Instance.PreviousScene = AreaName;

            if (!SceneToLoad.Equals(Constants.MAP))
            {
                // only add scene if not going to map
                EventManager.Instance.AddEvent(SceneToLoad.GetSceneName());
            }

            LoadSceneLogic.Instance.LoadScene(SceneToLoad.GetSceneName());
        }
    }
コード例 #3
0
ファイル: UnlockArea.cs プロジェクト: xdaisy/osmose
 // Update is called once per frame
 void Update()
 {
     if (canActivate && GameManager.Instance.CanStartDialogue() && Input.GetButtonDown("Interact") && !Dialogue.Instance.dBox.activeSelf)
     {
         if (EventManager.Instance.DidEventHappened(SceneToUnlock.GetSceneName()))
         {
             // if scene was unlocked
             Dialogue.Instance.ShowDialogue(this.PostUnlockedDialogue, false);
         }
         else
         {
             // scene was not unlocked
             EventManager.Instance.AddEvent(SceneToUnlock.GetSceneName());
             Dialogue.Instance.ShowDialogue(this.PreUnlockedDialogue, false);
         }
     }
 }
コード例 #4
0
ファイル: LoadGame.cs プロジェクト: xdaisy/osmose
    /// <summary>
    /// Start a new game
    /// </summary>
    public void StartNewGame()
    {
        playClick();
        isContinue = false;
        GameManager.Instance.OnMainMenu = false;

        LoadSceneLogic.Instance.LoadScene(loadArea.GetSceneName());
    }
コード例 #5
0
ファイル: LogicSystemUI.cs プロジェクト: xdaisy/osmose
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Interact"))
        {
            // if press input
            if (!wrongAnswer && currDialogueIndx < currDialogue.Length - 1)
            {
                // update the dialogue to the next one
                currDialogueIndx++;
                updateDialogue();
            }
            else if (!wrongAnswer && numWrongGuesses >= lifeCount)
            {
                // go to game over screen
                GameManager.Instance.PreviousScene = sceneName.GetSceneName();
                LoadSceneLogic.Instance.LoadScene(Constants.GAMEOVER);
            }
            else if (!showPopup && !wrongAnswer && currStep < logicSteps.Length - 1)
            {
                // if can go to next logic step, progress
                currStep++;
                updateLogicStep();
            }
            else if (wrongAnswer)
            {
                showPopup   = true;
                wrongAnswer = false;
            }
            else if (showPopup)
            {
                // else show the popup after showing current logic step's dialogue
                handlePopup();
            }
            else if (currStep >= logicSteps.Length - 1)
            {
                // end of steps
                GameManager.Instance.PreviousScene = sceneName.GetSceneName();
                LoadSceneLogic.Instance.LoadScene(nextScene.GetSceneName());
            }
        }

        handleScroll();
    }
コード例 #6
0
ファイル: CutsceneEntrance.cs プロジェクト: xdaisy/osmose
    // Use this for initialization
    void Start()
    {
        if (transitionFromCutscene.GetSceneName().Equals(GameManager.Instance.PreviousScene))
        {
            // set player to entrance's position
            PlayerControls.Instance.SetPosition(transform.position);

            if (ShowDialogue)
            {
                Dialogue.Instance.ShowDialogue(PostDialogue, true);
            }
        }
    }
コード例 #7
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButtonDown("Interact") && canActivate && !showingDialogue)
     {
         showingDialogue = true;
         Dialogue.Instance.ShowDialogue(dialogue, false);
     }
     else if (showingDialogue && !Dialogue.Instance.GetDialogueActive())
     {
         InteractMark mark = GameObject.FindObjectOfType <InteractMark>();
         mark.SetMarkOff();
         LoadSceneLogic.Instance.LoadScene(sceneToLoad.GetSceneName());
     }
 }
コード例 #8
0
 /// <summary>
 /// Change the scene
 /// </summary>
 private void changeScene()
 {
     GameManager.Instance.PreviousScene = CutsceneName;
     PlayerControls.Instance.SetPlayerForward();
     GameManager.Instance.InCutscene = false;
     if (ScenesToUnlock.Length > 0)
     {
         // if there's a scene to be unlocked after this cutscene, unlock it
         foreach (SceneName scene in ScenesToUnlock)
         {
             EventManager.Instance.AddEvent(scene.GetSceneName());
         }
     }
     LoadSceneLogic.Instance.LoadScene(sceneToLoad.GetSceneName());
 }
コード例 #9
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButtonDown("Interact") && canShowDialogue())
     {
         string[] dialogue = getDialogue();
         if (canAddClue())
         {
             // did not investigate yet
             CluesManager.Instance.ObtainedClue(Clue.GetClueNumber());
             GameManager.Instance.AddClue(Clue);
             if (sceneToUnlock != null)
             {
                 EventManager.Instance.AddEvent(sceneToUnlock.GetSceneName());
             }
         }
         Dialogue.Instance.ShowDialogue(dialogue, false);
     }
 }
コード例 #10
0
    // Use this for initialization
    void Start()
    {
        if (transitionFromCutscene.GetSceneName().Equals(GameManager.Instance.PreviousScene))
        {
            // set player to entrance's position
            PlayerControls.Instance.SetPosition(transform.position);
            List <string> dialogue = new List <string>();

            if (!GameManager.Instance.DidSeeTutorial())
            {
                // show tutorial if haven't seen the tutorial yet
                dialogue.AddRange(tutorial);
            }
            // show the dialogue
            dialogue.AddRange(PostDialogue);

            Dialogue.Instance.ShowDialogue(dialogue.ToArray(), true);
        }
    }
コード例 #11
0
ファイル: ActivatePuzzle.cs プロジェクト: xdaisy/osmose
 // Update is called once per frame
 void Update()
 {
     if (canActivate && GameManager.Instance.CanStartDialogue() && Input.GetButtonDown("Interact") && !Dialogue.Instance.dBox.activeSelf)
     {
         bool canDoPuzzle = GameManager.Instance.GetCurrentClues().Count == NumClues;
         Dialogue.Instance.ActivatePuzzleDialogue(InitialDialogue, YesDialogue, NoDialogue, CannotDialogue, canDoPuzzle, sceneToLoad.GetSceneName());
     }
 }