added queue to barks, modified barks manager, barks trigger
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using PixelCrushers.DialogueSystem;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
[System.Serializable]
|
||||
public class ActionResponse
|
||||
{
|
||||
public string barkText;
|
||||
[Tooltip("Conversation to get bark content from.")]
|
||||
[ConversationPopup(false)]
|
||||
public string barkConversation;
|
||||
public AudioClip audioClip;
|
||||
public UnityEvent responseEvent;
|
||||
public float delay = 0f;
|
||||
|
||||
@@ -20,8 +20,9 @@ public class QuestTriggerBase : Saver
|
||||
public bool wasFired;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
virtual public void Awake()
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
m_audioSource = GetComponent<AudioSource>();
|
||||
m_audioSource.playOnAwake = false;
|
||||
gameObject.layer = LayerMask.NameToLayer("Triggers");
|
||||
@@ -40,13 +41,15 @@ public class QuestTriggerBase : Saver
|
||||
|
||||
}
|
||||
|
||||
public virtual void Start()
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
Player.Instance.ThirdPersonController.onDead.AddListener(OnDead);
|
||||
}
|
||||
|
||||
public virtual void OnDestroy()
|
||||
public override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
if (Player.Instance != null && Player.Instance.ThirdPersonController != null)
|
||||
Player.Instance.ThirdPersonController.onDead.RemoveListener(OnDead);
|
||||
}
|
||||
@@ -83,9 +86,10 @@ public class QuestTriggerBase : Saver
|
||||
m_audioSource.clip = action.audioClip;
|
||||
m_audioSource.Play();
|
||||
}
|
||||
if (action.barkText != null && action.barkText != "")
|
||||
if (action.barkConversation != null && action.barkConversation != "")
|
||||
{
|
||||
DialogueManager.BarkString(action.barkText, m_player);
|
||||
//DialogueManager.BarkString(action.barkText, m_player);
|
||||
BarkManager.Instance.PlayBark(action.barkConversation);
|
||||
}
|
||||
if (action.responseEvent != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user