Passion & UI
This commit is contained in:
@@ -53,5 +53,11 @@ namespace Cielonos.Narrative
|
||||
startInventory.consumables.Add(itemSaveData);
|
||||
}
|
||||
}
|
||||
|
||||
[YarnFunction("check_have_item")]
|
||||
public static bool CheckHaveItem(string itemClass)
|
||||
{
|
||||
return MainGameManager.Player.inventorySc.backpackSm.HaveItem(itemClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Assets/Scripts/MainGame/Narrative/NarrativeTriggers.meta
Normal file
8
Assets/Scripts/MainGame/Narrative/NarrativeTriggers.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8721503fdcd8f3b49aa18debeee1787a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -17,7 +17,7 @@ namespace Cielonos.MainGame.Narrative
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
// 如果是一次性触发器且已经激活过,直接忽略
|
||||
if (oneShot && hasFired)
|
||||
if (once && hasTriggered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace Cielonos.MainGame.Narrative
|
||||
if (other.CompareTag(playerTag))
|
||||
{
|
||||
Debug.Log($"[AreaNarrativeTrigger] 玩家进入区域 '{gameObject.name}',激活剧情故事 ID: '{storyId}'");
|
||||
Fire();
|
||||
Trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,10 @@ using UnityEngine;
|
||||
namespace Cielonos.MainGame.Narrative
|
||||
{
|
||||
/// <summary>
|
||||
/// 自动启动剧情触发器。
|
||||
/// 自动计时器剧情触发器。
|
||||
/// 当场景加载完成并且该脚本执行 Start 生命周期时,自动启动指定剧情(常用于关卡旁白、开场白或开局引导)。
|
||||
/// </summary>
|
||||
public class StartNarrativeTrigger : NarrativeTrigger
|
||||
public class TimerNarrativeTrigger : NarrativeTrigger
|
||||
{
|
||||
[Header("Start Trigger Settings")]
|
||||
[SerializeField]
|
||||
@@ -29,13 +29,13 @@ namespace Cielonos.MainGame.Narrative
|
||||
private void ExecuteStartTrigger()
|
||||
{
|
||||
// 一次性触发器安全保护
|
||||
if (oneShot && hasFired)
|
||||
if (once && hasTriggered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[StartNarrativeTrigger] 场景启动自动触发剧情故事 ID: '{storyId}',延迟: {delaySeconds} 秒");
|
||||
Fire();
|
||||
Trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user