Code: Select all
DialogueSystemTrigger dialogueTrigger = FindObjectOfType<DialogueSystemTrigger>();
Code: Select all
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
Code: Select all
DialogueSystemTrigger dialogueTrigger = FindObjectOfType<DialogueSystemTrigger>();
Code: Select all
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
Code: Select all
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem.Wrappers
{
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
protected override void DoConversationAction(Transform actor)
{
LastInteractedDialogueSystemTrigger = this;
base.DoConversationAction(actor);
}
}
}
How my Custom Dialogue System Trigger is set up:'CustomDialogueSystemTrigger' does not contain a definition for 'LastInteractedSystemTrigger'
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem
{
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
protected override void DoConversationAction(Transform actor)
{
LastInteractedDialogueSystemTrigger = this;
base.DoConversationAction(actor);
}
}
}
Code: Select all
using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandReenableDialogue : SequencerCommand
{ // Rename to SequencerCommand<YourCommand>
public void Awake()
{
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
dialogueTrigger.LastInteractedSystemTrigger.enabled = true; //Missing reference.
Stop();
}
}
}
Code: Select all
if (dialogueTrigger != null && dialogueTrigger.LastInteractedSystemTrigger != null)
{
dialogueTrigger.LastInteractedSystemTrigger.enabled = true;
}
Code: Select all
dialogueTrigger?.LastInteractedSystemTrigger?.enabled = true;
Code: Select all
public class SequencerCommandReenableDialogue : SequencerCommand
{ // Rename to SequencerCommand<YourCommand>
public void Awake()
{
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
dialogueTrigger.LastInteractedSystemTrigger.enabled = true; //Still does not contain a definition for LastInteractedSystemTrigger.
Stop();
}
}
Code: Select all
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
Code: Select all
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger;
Code: Select all
using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandReenableDialogue : SequencerCommand
{
public void Awake()
{
CustomDialogueSystemTrigger.LastInteractedSystemTrigger?.enabled = true;
Stop();
}
}
}
Code: Select all
using UnityEngine;
using System.Collections;
using PixelCrushers.DialogueSystem;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandReenableDialogue : SequencerCommand
{
public void Awake()
{
Debug.Log("Re-enabling: " + CustomDialogueSystemTrigger.LastInteractedSystemTrigger, CustomDialogueSystemTrigger.LastInteractedSystemTrigger);
CustomDialogueSystemTrigger.LastInteractedSystemTrigger?.enabled = true;
Stop();
}
}
}
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem
{
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
protected override void DoConversationAction(Transform actor)
{
Debug.Log("Recording LastInteractedDialogueSystemTrigger = " + this);
LastInteractedDialogueSystemTrigger = this;
base.DoConversationAction(actor);
}
}
}
Assets\Scripts\Sequencer\SequencerCommandReenableDialogue.cs(12,69): error CS0117: 'CustomDialogueSystemTrigger' does not contain a definition for 'LastInteractedSystemTrigger'