FANDOM


This script causes a Conversation's previously-chosen dialog options to become skippable.

For it to work, you must rely on separate DialogOption ActionLists for each option, as opposed to checking Override options? in the Dialogue: Start conversation Action.

To use it, paste the code below into a C# file named DynamicSkipConv, and attach it to a GameObject in your scene.

using UnityEngine;
using System.Collections;
using AC;

public class DynamicSkipConv : MonoBehaviour
{

    private void OnEnable ()
    {
        EventManager.OnStartConversation += OnStartConversation;
    }

    private void OnDisable ()
    {
        EventManager.OnStartConversation -= OnStartConversation;
    }

    private void OnStartConversation (Conversation conversation)
    {
        foreach (ButtonDialog option in conversation.options)
        {
            if (option.assetFile != null)
            {
                option.assetFile.isSkippable = option.hasBeenChosen;
            }
            else if (option.dialogueOption != null)
            {
                option.dialogueOption.isSkippable = option.hasBeenChosen;
            }
        }
    }

}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.