This commit is contained in:
2026-07-27 23:30:25 +08:00
parent 738b2b2d36
commit 44a1029070
17 changed files with 611 additions and 21 deletions
@@ -115,6 +115,24 @@ public class MonsterControl_BossBase : MonsterContral
isyz = isyuzhen;
this.yzID = yzID;
// ⭐ 创建视频处理:配置了 createVideoClip 时通过 GameMainPanel 的播放器播放
// 播放期间 OnMoveUpdata 会跳过移动,视频结束后才开始走路线
_createVideoDuration = 0f;
_isPlayingCreateVideo = false;
var videoPlayer = CreateFishManager.Instance?.currGameType?.createVideoPlayer;
if (createVideoClip != null && videoPlayer != null)
{
// 显示视频控件
videoPlayer.gameObject.SetActive(true);
videoPlayer.Stop();
videoPlayer.clip = createVideoClip;
// ⭐ 注册播放结束回调:视频播完自动隐藏控件 + 重置状态
videoPlayer.loopPointReached -= OnCreateVideoFinished;
videoPlayer.loopPointReached += OnCreateVideoFinished;
videoPlayer.Play();
_isPlayingCreateVideo = true;
}
// Boss 进场播报
if (GameManager.Instance.gameData.currGameType == GameType.XJMH)
{
@@ -137,6 +155,21 @@ public class MonsterControl_BossBase : MonsterContral
}
}
/// <summary>
/// 创建视频播放结束回调:隐藏视频控件 + 重置播放状态
/// (用 loopPointReached 事件,比 OnMoveUpdata 检测更可靠,
/// 因为 isMove=false 的 Boss 不会进入 OnMoveUpdata 的视频检测分支)
/// </summary>
private void OnCreateVideoFinished(UnityEngine.Video.VideoPlayer player)
{
_isPlayingCreateVideo = false;
if (player != null)
{
player.Stop();
player.gameObject.SetActive(false);
}
}
// ==================== 爆奖(公共) ====================
/// <summary>确保分数显示文本存在(自动创建)</summary>