added use unce to dialogue trigger and trigger editor
This commit is contained in:
@@ -165,6 +165,8 @@ namespace PixelCrushers.DialogueSystem
|
|||||||
questPicker.showReferenceDatabase = false;
|
questPicker.showReferenceDatabase = false;
|
||||||
}
|
}
|
||||||
if (newDatabase != null) EditorTools.selectedDatabase = newDatabase;
|
if (newDatabase != null) EditorTools.selectedDatabase = newDatabase;
|
||||||
|
var fireOnceProperty = serializedObject.FindProperty("fireOnce");
|
||||||
|
EditorGUILayout.PropertyField(fireOnceProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void DrawConditions()
|
protected virtual void DrawConditions()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace PixelCrushers.DialogueSystem
|
|||||||
[Tooltip("The trigger that this component listens for.")]
|
[Tooltip("The trigger that this component listens for.")]
|
||||||
[DialogueSystemTriggerEvent]
|
[DialogueSystemTriggerEvent]
|
||||||
public DialogueSystemTriggerEvent trigger = DialogueSystemTriggerEvent.OnUse;
|
public DialogueSystemTriggerEvent trigger = DialogueSystemTriggerEvent.OnUse;
|
||||||
|
public bool fireOnce = true;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The conditions under which the trigger will fire.
|
/// The conditions under which the trigger will fire.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -363,7 +363,7 @@ namespace PixelCrushers.DialogueSystem
|
|||||||
protected bool didIPause = false;
|
protected bool didIPause = false;
|
||||||
protected float preConversationTimeScale = 1;
|
protected float preConversationTimeScale = 1;
|
||||||
protected bool tryingToStart = false;
|
protected bool tryingToStart = false;
|
||||||
|
protected bool hasFired = false;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Trigger Checks
|
#region Trigger Checks
|
||||||
@@ -609,6 +609,8 @@ namespace PixelCrushers.DialogueSystem
|
|||||||
public void TryStart(Transform actor, Transform interactor)
|
public void TryStart(Transform actor, Transform interactor)
|
||||||
{
|
{
|
||||||
if (tryingToStart) return;
|
if (tryingToStart) return;
|
||||||
|
if (fireOnce && hasFired)
|
||||||
|
return;
|
||||||
tryingToStart = true;
|
tryingToStart = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -626,6 +628,7 @@ namespace PixelCrushers.DialogueSystem
|
|||||||
public void Fire(Transform actor)
|
public void Fire(Transform actor)
|
||||||
{
|
{
|
||||||
if (DialogueDebug.logInfo) Debug.Log("Dialogue System: Dialogue System Trigger is firing " + trigger + ".", this);
|
if (DialogueDebug.logInfo) Debug.Log("Dialogue System: Dialogue System Trigger is firing " + trigger + ".", this);
|
||||||
|
hasFired = true;
|
||||||
DoQuestAction();
|
DoQuestAction();
|
||||||
DoLuaAction();
|
DoLuaAction();
|
||||||
DoSequenceAction(actor);
|
DoSequenceAction(actor);
|
||||||
|
|||||||
Reference in New Issue
Block a user