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