Example #1
0
    private void FinishLevel()
    {
        if (mustFinishLevel && hasPlayerInArea)
        {
            OnPuzzleCompleted.Invoke();
            OnPuzzleClosed.Invoke();

            if (door != null)
            {
                SendGameCommand sendGameCommand = new SendGameCommand();

                sendGameCommand.interactionType   = GameCommandType.Open;
                sendGameCommand.interactiveObject = door;
                sendGameCommand.coolDown          = 1;
                sendGameCommand.oneShot           = true;
                sendGameCommand.Send();
            }

            if (healthBox != null)
            {
                healthBox.GetComponent <InteractHealthBox>().OnInteractHealthBox();
            }

            mustFinishLevel = false;
        }
    }
Example #2
0
    public override void PerformInteraction()
    {
        activate = true;
        if (OnStartCommand != null)
        {
            OnStartCommand.Send();
        }

        SpawnOnce();
    }
Example #3
0
    private void ManipulateNextLevel()
    {
        if (currentLevel == 1)
        {
            currentIndexTextStep++;

            if (currentStep == 1)
            {
                if (currentIndexTextStep > 5)
                {
                    DesactiveDialogLevel01();
                    SendGameCommand sendGameCommand = new SendGameCommand();

                    sendGameCommand.interactionType   = GameCommandType.Open;
                    sendGameCommand.interactiveObject = doorStepLevel01Step01;
                    sendGameCommand.coolDown          = 1;
                    sendGameCommand.oneShot           = true;
                    sendGameCommand.Send();

                    moneyCanvas.SetActive(true);
                    return;
                }

                ActivateCanvasWithTranslatedText(listTextLevel01Step01[currentIndexTextStep]);
                return;
            }

            if (currentStep == 2)
            {
                if (currentIndexTextStep > 5)
                {
                    DesactiveDialogLevel01();
                    return;
                }

                ActivateCanvasWithTranslatedText(listTextLevel01Step02[currentIndexTextStep]);
                return;
            }

            if (currentStep == 3)
            {
                if (currentIndexTextStep > 4)
                {
                    DesactiveDialogLevel01();
                    return;
                }

                ActivateCanvasWithTranslatedText(listTextLevel01Step03[currentIndexTextStep]);
                return;
            }
        }

        DeactivateCanvasWithDelay(0f);
    }
Example #4
0
    public IEnumerator GameOver()
    {
        yield return(new WaitForSeconds(2f));

        SendGameCommand sendGameCommand = new SendGameCommand();

        sendGameCommand.interactionType   = GameCommandType.Open;
        sendGameCommand.interactiveObject = hugeDoor;
        sendGameCommand.coolDown          = 1;
        sendGameCommand.oneShot           = true;
        sendGameCommand.Send();

        yield return(new WaitForSeconds(9f));

        Destroy(boss);
        cameraMain.enabled     = false;
        cameraGameOver.enabled = true;
        Ellen.SetActive(false);
        OnDialogShow.Invoke();
        OnDialogClose.Invoke();

        for (int i = 0; i < 5; i++)
        {
            GameObject person01 = Resources.Load <GameObject>("Prefabs/TT_demo_female");
            Instantiate(person01, spawnPointPerson01.transform.position, spawnPointPerson01.transform.rotation, this.transform);
            yield return(new WaitForSeconds(1f));

            GameObject person02 = Resources.Load <GameObject>("Prefabs/TT_demo_male_A");
            person02.transform.SetPositionAndRotation(spawnPointPerson02.transform.position, spawnPointPerson02.transform.rotation);
            Instantiate(person02, spawnPointPerson02.transform.position, spawnPointPerson02.transform.rotation, this.transform);
            yield return(new WaitForSeconds(1f));

            GameObject person03 = Resources.Load <GameObject>("Prefabs/TT_demo_male_B");
            Instantiate(person03, spawnPointPerson03.transform.position, spawnPointPerson03.transform.rotation, this.transform);
            yield return(new WaitForSeconds(1f));
        }

        ScreenFader.SetAlpha(1f);
        StartCoroutine(ScreenFader.FadeSceneOut(ScreenFader.FadeType.GameOver));
        finishGame = true;
    }