示例#1
0
    private void PresentLine(DialogueText text)
    {
        UpdateAdvanceLockout();

        SpeakerName.Text = text.SpeakerName;
        SpeakerText.Text = text.SpeakerText;

        if (text.BGMOverride != null)
        {
            _maestro.ChangeTunes(text.BGMOverride);
        }

        if (text.OneShotClip != null)
        {
            _maestro.PlaySoundEffect(text.OneShotClip, 1.0f);
        }

        if (!string.IsNullOrEmpty(text.ConversationEvent))
        {
            if (DebugMode)
            {
                Debug.Log("Sending message " + text.ConversationEvent + " to own scripts...");
            }

            gameObject.SendMessage(text.ConversationEvent, SendMessageOptions.RequireReceiver);
        }

        if (!string.IsNullOrEmpty(text.ConversationGift))
        {
            _ambassador.GainItem(text.ConversationGift);
        }

        if (text.AltersProgression)
        {
            _ambassador.UpdateThread(
                text.QuestThreadName,
                text.ResultingQuestThreadPhase,
                text.ThreadQuestTitle,
                text.ThreadQuestDetails
                );

            gameObject.SendMessage("RefreshQuestDetails", SendMessageOptions.DontRequireReceiver);
        }

        if (text.CausesSelfDestruct)
        {
            if (DebugMode)
            {
                Debug.Log("Destroying current object, reverting flags, and re-acquiring list of text sources.");
            }

            Destroy(_currentThread.CallingGameObject);
            DialogueAvailable = false;
            GUIShowing        = false;

            _textProviders = (EntityText[])FindObjectsOfType(typeof(EntityText));
        }
    }
示例#2
0
 void OnDestroy()
 {
     _ambassador.UpdateThread(ThreadName, NewPhase, QuestTitle, QuestDetails);
 }