Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (on)
        {
            subtitle.gameObject.SetActive(true);

            if (subtitle_clip != null)
            {
                subtitle_clip.StartClip();

                if (subtitle_clip.IsClipDone())
                {
                    on = false;
                }
            }
        }
        else
        {
            if (subtitle_clip != null)
            {
                subtitle_clip.Reset();
            }

            subtitle.gameObject.SetActive(false);
        }
    }
Пример #2
0
    //Check for the condition that will cause the next dialog menu to fire.
    //Depending on the menu's name (i.e. what stage we are in the ceremony) different things will cause it.
    //I.e. when the audio file stops playing, when Mrs. Ling's animation stops, etc.
    public void CheckForEndCondition()
    {
        if (dialog_clip == null)
        {
            return;
        }

        if (dialog_clip.IsClipDone() || (Settings.debug && Input.GetKeyDown(KeyCode.Mouse1)))
        {
            delay_timer += Time.deltaTime;
            if (delay_timer >= delay)
            {
                delay_timer = 0;
                dialog_clip.Reset();
                start_check_for_end_cond = false;
                OnEndCond(this, next_menu);
            }
        }
    }