added queue to barks, modified barks manager, barks trigger
This commit is contained in:
@@ -9524,7 +9524,7 @@ MonoBehaviour:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Sequence
|
||||
value: AudioWait(Dialogues/VO/CH01/CH01_wasteland_vo_opening_wanderer_01)
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: pl
|
||||
@@ -9550,7 +9550,7 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
canvasRect:
|
||||
serializedVersion: 2
|
||||
x: 20
|
||||
x: 19
|
||||
y: 80
|
||||
width: 160
|
||||
height: 30
|
||||
@@ -15983,6 +15983,394 @@ MonoBehaviour:
|
||||
height: 30
|
||||
canvasScrollPosition: {x: 0, y: 0}
|
||||
canvasZoom: 1
|
||||
- id: 56
|
||||
fields:
|
||||
- title: Title
|
||||
value: Barks/Combat/InsectsLargerThanVultures
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Pictures
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Description
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Actor
|
||||
value: 1
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Conversant
|
||||
value: 2
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
overrideSettings:
|
||||
useOverrides: 0
|
||||
overrideSubtitleSettings: 0
|
||||
showNPCSubtitlesDuringLine: 1
|
||||
showNPCSubtitlesWithResponses: 1
|
||||
showPCSubtitlesDuringLine: 0
|
||||
skipPCSubtitleAfterResponseMenu: 0
|
||||
subtitleCharsPerSecond: 30
|
||||
minSubtitleSeconds: 2
|
||||
continueButton: 0
|
||||
overrideSequenceSettings: 0
|
||||
defaultSequence:
|
||||
defaultPlayerSequence:
|
||||
defaultResponseMenuSequence:
|
||||
overrideInputSettings: 0
|
||||
alwaysForceResponseMenu: 1
|
||||
includeInvalidEntries: 0
|
||||
responseTimeout: 0
|
||||
cancelSubtitle:
|
||||
key: 27
|
||||
buttonName:
|
||||
cancelConversation:
|
||||
key: 27
|
||||
buttonName:
|
||||
nodeColor:
|
||||
dialogueEntries:
|
||||
- id: 0
|
||||
fields:
|
||||
- title: Title
|
||||
value: START
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Pictures
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Description
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Actor
|
||||
value: 1
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Conversant
|
||||
value: 2
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Menu Text
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Dialogue Text
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Parenthetical
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Audio Files
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Video File
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Sequence
|
||||
value: None()
|
||||
type: 0
|
||||
typeString:
|
||||
- title: pl
|
||||
value:
|
||||
type: 4
|
||||
typeString: CustomFieldType_Localization
|
||||
conversationID: 56
|
||||
isRoot: 0
|
||||
isGroup: 0
|
||||
nodeColor:
|
||||
delaySimStatus: 0
|
||||
falseConditionAction: Block
|
||||
conditionPriority: 2
|
||||
outgoingLinks:
|
||||
- originConversationID: 56
|
||||
originDialogueID: 0
|
||||
destinationConversationID: 56
|
||||
destinationDialogueID: 1
|
||||
isConnector: 0
|
||||
priority: 2
|
||||
conditionsString:
|
||||
userScript:
|
||||
onExecute:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
canvasRect:
|
||||
serializedVersion: 2
|
||||
x: 21
|
||||
y: 30
|
||||
width: 160
|
||||
height: 30
|
||||
- id: 1
|
||||
fields:
|
||||
- title: Title
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Pictures
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Description
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Actor
|
||||
value: 2
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Conversant
|
||||
value: 1
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Menu Text
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Dialogue Text
|
||||
value: Insects larger than vultures! And with a bite to match!
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Parenthetical
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Audio Files
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Video File
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Sequence
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: pl
|
||||
value:
|
||||
type: 4
|
||||
typeString: CustomFieldType_Localization
|
||||
conversationID: 56
|
||||
isRoot: 0
|
||||
isGroup: 0
|
||||
nodeColor:
|
||||
delaySimStatus: 0
|
||||
falseConditionAction: Block
|
||||
conditionPriority: 2
|
||||
outgoingLinks: []
|
||||
conditionsString:
|
||||
userScript:
|
||||
onExecute:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
canvasRect:
|
||||
serializedVersion: 2
|
||||
x: 21
|
||||
y: 80
|
||||
width: 160
|
||||
height: 30
|
||||
canvasScrollPosition: {x: 0, y: 0}
|
||||
canvasZoom: 1
|
||||
- id: 57
|
||||
fields:
|
||||
- title: Title
|
||||
value: Barks/Misc/WoodenBoxes
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Pictures
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Description
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Actor
|
||||
value: 1
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Conversant
|
||||
value: 2
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
overrideSettings:
|
||||
useOverrides: 0
|
||||
overrideSubtitleSettings: 0
|
||||
showNPCSubtitlesDuringLine: 1
|
||||
showNPCSubtitlesWithResponses: 1
|
||||
showPCSubtitlesDuringLine: 0
|
||||
skipPCSubtitleAfterResponseMenu: 0
|
||||
subtitleCharsPerSecond: 30
|
||||
minSubtitleSeconds: 2
|
||||
continueButton: 0
|
||||
overrideSequenceSettings: 0
|
||||
defaultSequence:
|
||||
defaultPlayerSequence:
|
||||
defaultResponseMenuSequence:
|
||||
overrideInputSettings: 0
|
||||
alwaysForceResponseMenu: 1
|
||||
includeInvalidEntries: 0
|
||||
responseTimeout: 0
|
||||
cancelSubtitle:
|
||||
key: 27
|
||||
buttonName:
|
||||
cancelConversation:
|
||||
key: 27
|
||||
buttonName:
|
||||
nodeColor:
|
||||
dialogueEntries:
|
||||
- id: 0
|
||||
fields:
|
||||
- title: Title
|
||||
value: START
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Pictures
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Description
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Actor
|
||||
value: 1
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Conversant
|
||||
value: 2
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Menu Text
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Dialogue Text
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Parenthetical
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Audio Files
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Video File
|
||||
value:
|
||||
type: 0
|
||||
typeString:
|
||||
- title: Sequence
|
||||
value: None()
|
||||
type: 0
|
||||
typeString:
|
||||
- title: pl
|
||||
value:
|
||||
type: 4
|
||||
typeString: CustomFieldType_Localization
|
||||
conversationID: 57
|
||||
isRoot: 0
|
||||
isGroup: 0
|
||||
nodeColor:
|
||||
delaySimStatus: 0
|
||||
falseConditionAction:
|
||||
conditionPriority: 2
|
||||
outgoingLinks:
|
||||
- originConversationID: 57
|
||||
originDialogueID: 0
|
||||
destinationConversationID: 57
|
||||
destinationDialogueID: 1
|
||||
isConnector: 0
|
||||
priority: 2
|
||||
conditionsString:
|
||||
userScript:
|
||||
onExecute:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
canvasRect:
|
||||
serializedVersion: 2
|
||||
x: 20
|
||||
y: 30
|
||||
width: 160
|
||||
height: 30
|
||||
- id: 1
|
||||
fields:
|
||||
- title: Title
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Pictures
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Description
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Actor
|
||||
value: 2
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Conversant
|
||||
value: 1
|
||||
type: 5
|
||||
typeString: CustomFieldType_Actor
|
||||
- title: Menu Text
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Dialogue Text
|
||||
value: Wooden Boxes!
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Parenthetical
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Audio Files
|
||||
value: '[]'
|
||||
type: 3
|
||||
typeString: CustomFieldType_Files
|
||||
- title: Video File
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: Sequence
|
||||
value:
|
||||
type: 0
|
||||
typeString: CustomFieldType_Text
|
||||
- title: pl
|
||||
value:
|
||||
type: 4
|
||||
typeString: CustomFieldType_Localization
|
||||
conversationID: 57
|
||||
isRoot: 0
|
||||
isGroup: 0
|
||||
nodeColor:
|
||||
delaySimStatus: 0
|
||||
falseConditionAction: Block
|
||||
conditionPriority: 2
|
||||
outgoingLinks: []
|
||||
conditionsString:
|
||||
userScript:
|
||||
onExecute:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
canvasRect:
|
||||
serializedVersion: 2
|
||||
x: 20
|
||||
y: 80
|
||||
width: 160
|
||||
height: 30
|
||||
canvasScrollPosition: {x: 0, y: 0}
|
||||
canvasZoom: 1
|
||||
syncInfo:
|
||||
syncActors: 0
|
||||
syncItems: 0
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Pixel Crushers. All rights reserved.
|
||||
|
||||
using UnityEditor.Localization.Platform.iOS;
|
||||
using UnityEngine;
|
||||
|
||||
namespace PixelCrushers.DialogueSystem.Wrappers
|
||||
@@ -13,6 +14,7 @@ namespace PixelCrushers.DialogueSystem.Wrappers
|
||||
[AddComponentMenu("Pixel Crushers/Dialogue System/Trigger/Dialogue System Trigger")]
|
||||
public class DialogueSystemTrigger : PixelCrushers.DialogueSystem.DialogueSystemTrigger
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using PixelCrushers.DialogueSystem;
|
||||
using Sirenix.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Beyond
|
||||
@@ -15,6 +17,9 @@ namespace Beyond
|
||||
public ActionResponse m_actionResponse;
|
||||
|
||||
public MaterialChanger[] m_materialsToChange;
|
||||
//[Tooltip("Conversation to get bark content from.")]
|
||||
//[ConversationPopup(false)]
|
||||
//public string m_conversationBark = string.Empty;
|
||||
|
||||
|
||||
[Serializable]
|
||||
@@ -86,6 +91,11 @@ namespace Beyond
|
||||
}
|
||||
}
|
||||
|
||||
//if (!m_conversationBark.IsNullOrWhitespace())
|
||||
//{
|
||||
// BarkManager.Instance.PlayBark(m_conversationBark);
|
||||
//}
|
||||
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using PixelCrushers;
|
||||
using PixelCrushers.DialogueSystem;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.Utilities;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
@@ -14,6 +15,9 @@ namespace Beyond
|
||||
[Serializable]
|
||||
public class Bark
|
||||
{
|
||||
[Tooltip("Conversation to get bark content from.")]
|
||||
[ConversationPopup(false)]
|
||||
public string barkConversation = string.Empty;
|
||||
public string barkText;
|
||||
public AudioClip clip;
|
||||
}
|
||||
@@ -39,6 +43,26 @@ namespace Beyond
|
||||
public Queue<int> m_barkQueue = new Queue<int>();
|
||||
public AudioSource m_audioSource;
|
||||
|
||||
private Dictionary<string, int> m_conversationToEntry = new Dictionary<string, int>();
|
||||
|
||||
private static BarkManager s_instance;
|
||||
|
||||
public static BarkManager Instance => s_instance;
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
if (s_instance != null)
|
||||
{
|
||||
Debug.LogError("BarkManager instance already exists! destroying...");
|
||||
Destroy(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_instance = this;
|
||||
}
|
||||
}
|
||||
|
||||
public void PlayBark(int num)
|
||||
{
|
||||
m_barkQueue.Enqueue(num);
|
||||
@@ -72,6 +96,19 @@ namespace Beyond
|
||||
*/
|
||||
}
|
||||
|
||||
public void PlayBark(string conversation)
|
||||
{
|
||||
if (m_conversationToEntry.ContainsKey(conversation))
|
||||
{
|
||||
m_barkQueue.Enqueue(m_conversationToEntry[conversation]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("BarkManager: Conversation not found: "+conversation, this);
|
||||
}
|
||||
}
|
||||
|
||||
//private AudioSource audioSourceLast;
|
||||
//private GameObject audioSource => Player.Instance.audioSource;
|
||||
|
||||
@@ -118,6 +155,10 @@ namespace Beyond
|
||||
//audioSourceLast = audioObject.GetComponent<AudioSource>();
|
||||
m_audioSource.PlayOneShot(b.clip);
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(b.barkConversation))
|
||||
{
|
||||
DialogueManager.Bark(b.barkConversation, Player.Instance.transform);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(b.barkText))
|
||||
{
|
||||
DialogueManager.BarkString(b.barkText, Player.Instance.transform);
|
||||
@@ -145,6 +186,14 @@ namespace Beyond
|
||||
m_saveData.wasPlayed = new bool[m_barks.Length];
|
||||
for (int i = 0; i < m_saveData.wasPlayed.Length; i++)
|
||||
m_saveData.wasPlayed[i] = false;
|
||||
for (int i=0; i<m_barks.Length; i++)
|
||||
{
|
||||
var b = m_barks[i];
|
||||
if (b.barks.Length == 1 && !b.barks[0].barkConversation.IsNullOrWhitespace())
|
||||
{
|
||||
m_conversationToEntry[b.barks[0].barkConversation] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string RecordData()
|
||||
|
||||
Reference in New Issue
Block a user