Exemple #1
0
    private IEnumerator InteractionEnter()
    {
        yield return(new WaitForSecondsRealtime(0.2f)); // Wait a bit to make time for any potential quest change

        if (questGiver != null)
        {
            yield return(new WaitUntil(() => !questGiver.IsInitializingQuest()));
        }

        if (Dialogue != null)
        {
            if (!Dialogue.PrimaryDialogueSeen() || Dialogue.HasSecondary())
            {
                TransferDialogue(Dialogue, gameObject);
                if (creature != null)
                {
                    creature.TalkMode(true);
                }
            }
            else
            {
                ExitInteraction();
            }
        }
        else
        {
            ExitInteraction();
        }
    }
Exemple #2
0
    private void TransferDialogue(DialogueSet dialogue, GameObject sender)
    {
        if (Dialogue != null)
        {
            if (Dialogue.HasPrimary() || dialogue.HasSecondary())
            {
                Dialogue.OnDialogueEnded += ExitInteraction;

                if (Dialogue.FreezePlayerInDialogue)
                {
                    SetPlayerRestriction(true);
                }

                Dialogue.PushDialogue(sender);
                pushedDialogue = true;
            }
        }
    }