113 lines
3.3 KiB
C#
113 lines
3.3 KiB
C#
using UnityEngine;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
/// <summary>
|
|
/// 准备就位阶段
|
|
/// </summary>
|
|
public class LogicBattleFieldStateStart : LogicBattleFieldState
|
|
{
|
|
public static LogicBattleFieldState Creator (LogicBattleField field)
|
|
{
|
|
return new LogicBattleFieldStateStart (field);
|
|
}
|
|
|
|
Vector3 destPos = Vector3.zero;
|
|
float intervalSpace = 7;
|
|
float leftTime = 1;
|
|
bool bSwitchBossIntro = false;
|
|
bool switchCam = false;
|
|
|
|
public LogicBattleFieldStateStart (LogicBattleField field)
|
|
: base (field, LogicBattleFieldStateType.Start)
|
|
{
|
|
}
|
|
|
|
public override void OnEnter ()
|
|
{
|
|
mWaitFighterReadyTime = 0;
|
|
if (mField.IsChallengeBossMode)
|
|
{
|
|
if (mField.BattleInfo.ShowBossIntroType == (int)BossIntroType.Warning)
|
|
BattleMgr.Instance.ShowBossWarning();
|
|
else if (mField.BattleInfo.ShowBossIntroType == (int)BossIntroType.BossIntro)
|
|
bSwitchBossIntro = true;
|
|
|
|
if (!string.IsNullOrEmpty(mField.BattleInfo.BattleBgm))
|
|
{
|
|
mField.playingBattleMusic = true;
|
|
MusicMgr.Instance.PlayBGMusic(mField.BattleInfo.BattleBgm);
|
|
}
|
|
|
|
//BattleCamera.Instance.SetBlurEffectEnabled(true);
|
|
|
|
// UIBattleDeploy: Show
|
|
BattleMgr.Instance.IsWaittingPlayerStartGame = true;
|
|
}
|
|
mField.Battle.MoveToNextBattleField(false, true);
|
|
}
|
|
|
|
public override void OnLeave ()
|
|
{
|
|
}
|
|
|
|
private bool mIsShowUIBattleDeploy = false;
|
|
private float mWaitFighterReadyTime = 0;
|
|
private const bool USE_DEPLOY_UI = false;
|
|
public override void Update (float deltaTime)
|
|
{
|
|
mWaitFighterReadyTime += deltaTime;
|
|
if (mField.Battle.IsAllFightersReady())
|
|
{
|
|
if (USE_DEPLOY_UI && BattleMgr.Instance.IsWaittingPlayerStartGame)
|
|
{
|
|
if (mField.Battle.IsAllFightersReady() && mIsShowUIBattleDeploy == false)
|
|
{
|
|
if (mWaitFighterReadyTime > 5.5f)
|
|
{
|
|
mIsShowUIBattleDeploy = true;
|
|
BattleMgr.Instance.ShowUIBattleDeploy();
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
BattleMgr.Instance.SyncTeams(false);
|
|
if (bSwitchBossIntro)
|
|
{
|
|
ChangeState(LogicBattleFieldStateType.BossIntro);
|
|
}
|
|
else
|
|
{
|
|
//BattleMgr.Instance.SetBossBattleCamera();
|
|
ChangeState(LogicBattleFieldStateType.Fighting);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
mField.Battle.FighterMgr.FixedUpdate(deltaTime);
|
|
mField.Battle.BattleScene.UpdateSceneTree(mField.TeamFighters[0].Position);
|
|
}
|
|
}
|
|
|
|
public override void OnDataChanged()
|
|
{
|
|
|
|
}
|
|
|
|
//void CheckSwitchCam()
|
|
//{
|
|
// if (switchCam) return;
|
|
|
|
// if (mField.Battle.IsSelfReady())
|
|
// {
|
|
// if (!mField.killBoss) {
|
|
// BattleMgr.Instance.LookAtBattleFieldCenter();
|
|
// }
|
|
// switchCam = true;
|
|
// }
|
|
//}
|
|
}
|