Exemplo n.º 1
0
    public static void CloseDialogue()
    {
        if (!instance.isDialogueShown)
        {
            return;
        }

        instance.wrapper.SetActive(false);
        instance.isDialogueShown = false;

        instance.currentLinesIndex++;

        if (instance.currentLinesIndex >= instance.currentDialogueLines.Length)
        {
            AcceptingInputStatus.DisableAcceptingInput();
            LevelEnder.EndGame(instance.currentLevelEnd);
            return;
        }

        if (instance.currentDialogueLines[instance.currentLinesIndex - 1].showNextLineAfterThis)
        {
            instance.wrapper.SetActive(true); // to not blink away for the one frame
            Trigger(instance.currentLevelEnd);
        }
    }
Exemplo n.º 2
0
 // Adds given level ender as invoker of end level event
 public static void AddEndLevelInvoker(LevelEnder invoker)
 {
     // adds invoker to list and adds all listeners to this invoker
     endLevelInvokers.Add(invoker);
     foreach (UnityAction <bool, float> listener in endLevelListeners)
     {
         invoker.AddEndLevelListener(listener);
     }
 }
Exemplo n.º 3
0
    void Update()
    {
        if (CurrentPercentsByTime() == 100)
        {
            LevelEnd levelEnd = DialogueSystem.DialogueStarted() ? LevelEnd.INTERRUPTED : LevelEnd.PATIENT;
            LevelEnder.EndGame(levelEnd);
        }

        if (!dragging)
        {
            UpdateInnerBarPosition();
        }

        UpdatePercentsText();
    }
Exemplo n.º 4
0
    void Awake()
    {
        if (SceneManager.GetActiveScene().buildIndex == 0 || instance == null)
        {
            if (instance != null)
            {
                Destroy(instance.gameObject);
            }

            instance = this;
            DontDestroyOnLoad(gameObject);
            audioSource = GetComponent <AudioSource>();
            levelEnd    = LevelEnd.TEST;
        }
        else
        {
            Destroy(gameObject);
        }
    }