调整linkdoor
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using MoreMountains.Feedbacks;
|
||||
|
||||
@@ -12,7 +13,7 @@ namespace BaseGames.Feedback
|
||||
/// 用法:
|
||||
/// 1. 在需要反馈的 GameObject 上添加 SceneFeedback 组件
|
||||
/// 2. 在 Inspector 中将 MMF_Player 拖入 _player 槽位
|
||||
/// 3. 调用者持有 [SerializeField] SceneFeedback 引用,调用 .Play()
|
||||
/// 3. 调用者持有 [SerializeField] SceneFeedback 引用,调用 .Play() 或 yield return .PlayAndWait()
|
||||
/// </summary>
|
||||
[AddComponentMenu("BaseGames/Feedback/Scene Feedback")]
|
||||
public class SceneFeedback : MonoBehaviour
|
||||
@@ -24,5 +25,17 @@ namespace BaseGames.Feedback
|
||||
|
||||
/// <summary>立即停止正在播放的反馈。</summary>
|
||||
public void Stop() => _player?.StopFeedbacks();
|
||||
|
||||
/// <summary>
|
||||
/// 播放反馈并等待其完成后继续。若 _player 未配置则立即返回。
|
||||
/// 用于需要等待淡出/淡入完成后再执行下一步的场景(如传送、开门等)。
|
||||
/// </summary>
|
||||
public IEnumerator PlayAndWait()
|
||||
{
|
||||
if (_player == null) yield break;
|
||||
_player.PlayFeedbacks();
|
||||
while (_player.IsPlaying)
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user