| | |
| | |
|
| | | bool autoHandupRecord = false;
|
| | | int moveToNPCRecord = 0;
|
| | |
|
| | | bool rejectManual = false;
|
| | |
|
| | | TeamModel model { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
| | | #region Built-in
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | rejectManual = false;
|
| | | autoHandupRecord = PlayerDatas.Instance.hero.aiHandler.IsAuto();
|
| | | moveToNPCRecord = MapTransferUtility.Instance.NpcID;
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | if (rejectManual || model.teamPrepare.isError || model.teamPrepare.IsReject())
|
| | | {
|
| | | if (autoHandupRecord)
|
| | | {
|
| | | if (PlayerDatas.Instance.hero != null)
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StartHandupAI();
|
| | | }
|
| | |
|
| | | autoHandupRecord = false;
|
| | | }
|
| | |
|
| | | if (moveToNPCRecord != 0)
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(moveToNPCRecord);
|
| | | moveToNPCRecord = 0;
|
| | | }
|
| | | }
|
| | |
|
| | | model.memberPrepareStateChangeEvent -= ShowPrepareStates;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | |
|
| | | private void Reject()
|
| | | {
|
| | | if (autoHandupRecord)
|
| | | {
|
| | | if (PlayerDatas.Instance.hero != null)
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StartHandupAI();
|
| | | }
|
| | |
|
| | | autoHandupRecord = false;
|
| | | }
|
| | |
|
| | | if (moveToNPCRecord != 0)
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(moveToNPCRecord);
|
| | | moveToNPCRecord = 0;
|
| | | }
|
| | |
|
| | | var myPlayerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | var prepareState = model.teamPrepare.GetPlayerPrepareSate((int)myPlayerId);
|
| | | if (prepareState == TeammatePrepareState.UnPrepared)
|
| | | {
|
| | | model.ReqeustPrepareEnterDungeon(false);
|
| | | rejectManual = true;
|
| | | model.RequestPrepareEnterDungeon(false);
|
| | | WindowCenter.Instance.Close<TeamPrepareWin>();
|
| | | }
|
| | | }
|
| | |
| | | var prepareState = model.teamPrepare.GetPlayerPrepareSate((int)myPlayerId);
|
| | | if (prepareState == TeammatePrepareState.UnPrepared)
|
| | | {
|
| | | model.ReqeustPrepareEnterDungeon(true);
|
| | | model.RequestPrepareEnterDungeon(true);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | if (model.myTeam.iamCaptainer)
|
| | | {
|
| | | model.ReqeustPrepareEnterDungeon(false);
|
| | | rejectManual = true;
|
| | | model.RequestPrepareEnterDungeon(false);
|
| | | WindowCenter.Instance.Close<TeamPrepareWin>();
|
| | | }
|
| | | }
|