private void TryDialog() { if (StageMgr.MainPlayer != null) { var deploy = DialogMgr.GetBossDialog(StageMgr.MainPlayer.Deploy.id, Deploy.id, true); if (deploy != null) { var list = DialogMgr.GetDrawList(deploy.dialogId); UIDrawingChat.Show(list, () => { MoveToTarget(BossUpCenter, 10f); }, () => { StartFight(); if (deploy.bgmId > 0) { Sound.PlayMusic(deploy.bgmId); UIBgmTip.Show(deploy.bgmId); } }); return; } } //如果没有对话,直接移动到指定位置,并开始战斗 MoveToTarget(BossUpCenter, 10f); DOVirtual.DelayedCall(1.15F, StartFight, false); }
private IEnumerator DoBossDead() { //对话配置 var dialogDeploy = DialogMgr.GetBossDialog(StageMgr.MainPlayer.Deploy.id, Deploy.id, false); //隐藏血条 SetHpHudActive(false); //bossMark隐藏 UIBattle.SetBossMarkActive(false); yield return(new WaitForSeconds(0.3f)); //震屏 if (StageCamera2D.Instance) { StageCamera2D.Instance.Shake(0.7f, 1.2f); } if (StageCamera3D.Instance) { StageCamera3D.Instance.Shake(0.7f, 1.2f); } Sound.PlayUiAudioOneShot(105); //播放shader特效 StageCamera2D.Instance.PlayDeadEffect(transform.position); //隐藏renderer MainRenderer.enabled = false; if (_bossCircle) { _bossCircle.SetActiveSafe(false); } yield return(new WaitForSeconds(0.7f)); //尝试显示对话 if (dialogDeploy != null) { var list = DialogMgr.GetDrawList(dialogDeploy.dialogId); UIDrawingChat.Show(list, null, () => { GameEventCenter.Send(GameEvent.OnEnemyDie); }); } else { GameEventCenter.Send(GameEvent.OnEnemyDie); } yield return(new WaitForSeconds(0.3f)); Destroy(gameObject); }