Passion & UI
This commit is contained in:
@@ -25,30 +25,30 @@ namespace SLSUtilities.Narrative
|
||||
|
||||
[SerializeField]
|
||||
[Tooltip("是否仅能触发一次")]
|
||||
protected bool oneShot = true;
|
||||
protected bool once = true;
|
||||
|
||||
[ShowInInspector]
|
||||
[ReadOnly]
|
||||
[Tooltip("该触发器当前是否已经激活过")]
|
||||
protected bool hasFired;
|
||||
protected bool hasTriggered;
|
||||
|
||||
/// <summary>获取触发的目标故事 ID。</summary>
|
||||
public string StoryId => storyId;
|
||||
|
||||
/// <summary>是否是一次性触发器。</summary>
|
||||
public bool OneShot => oneShot;
|
||||
public bool Once => once;
|
||||
|
||||
/// <summary>该触发器是否已经激活过。</summary>
|
||||
public bool HasFired => hasFired;
|
||||
public bool HasTriggered => hasTriggered;
|
||||
|
||||
/// <summary>
|
||||
/// 激活触发器,通知订阅者启动剧情。
|
||||
/// </summary>
|
||||
[Button("测试触发 (Fire)", ButtonSizes.Small)]
|
||||
[Button("测试触发 (Trigger)", ButtonSizes.Small)]
|
||||
[GUIColor(0.3f, 0.8f, 1f)]
|
||||
public virtual void Fire()
|
||||
public virtual void Trigger()
|
||||
{
|
||||
if (oneShot && hasFired)
|
||||
if (once && hasTriggered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace SLSUtilities.Narrative
|
||||
return;
|
||||
}
|
||||
|
||||
hasFired = true;
|
||||
hasTriggered = true;
|
||||
OnNarrativeTriggerFired?.Invoke(storyId);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace SLSUtilities.Narrative
|
||||
[Button("重置激活状态 (Reset)", ButtonSizes.Small)]
|
||||
public virtual void ResetTrigger()
|
||||
{
|
||||
hasFired = false;
|
||||
hasTriggered = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user