That doesn't make any sense. You're defining it here:
Code: Select all
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
Code: Select all
public class CustomDialogueSystemTrigger : DialogueSystemTrigger
{
public static DialogueSystemTrigger LastInteractedDialogueSystemTrigger = null;
Code: Select all
public static GameObject TriggerObj;
Code: Select all
CustomDialogueSystemTrigger dialogueTrigger = FindObjectOfType<CustomDialogueSystemTrigger>();
dialogueTrigger.TriggerObj.SetActive(true);
Not sure if this helps.error CS0176: Member 'CustomDialogueSystemTrigger.TriggerObj' cannot be accessed with an instance reference; qualify it with a type name instead
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);
}
}
}
Code: Select all
using UnityEngine;
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandReenableDialogue : SequencerCommand
{
public void Awake()
{
Debug.Log("Re-enabling: " + CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger, CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger);
if (CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger != null)
{
CustomDialogueSystemTrigger.LastInteractedDialogueSystemTrigger.enabled = true;
}
Stop();
}
}
}
Code: Select all
private void OnTriggerStay(Collider other)
{
if (other.tag == "Player")
{
if (Input.GetKeyDown(KeyCode.F))
{
print("PRESSED");
var conversation = dialogueTrigger.conversation;
var actor = dialogueTrigger.conversationActor;
var conversant = dialogueTrigger.conversationConversant;
DialogueManager.StartConversation(conversation, actor, conversant);
interactSign.isInteractable = false;
disableDialogueTrigger();
}
if (dialogueTrigger.enabled)
{
interactSign.isInteractable = true;
}
}
}
Code: Select all
var conversation = dialogueTrigger.conversation;
var actor = dialogueTrigger.conversationActor;
var conversant = dialogueTrigger.conversationConversant;
DialogueManager.StartConversation(conversation, actor, conversant);
Code: Select all
dialogueTrigger.OnUse();