public void CheckPlayer() { if (PhotonSceneManager.GetInstance().currentRole != null) { currentState = StepXmlState.Wait; } }
public void FinishStep() { for (int i = 0; i < step_BaseList.Count; i++) { step_BaseList[i].AllFinish(); } step_Animation.PlayAnimation("End"); PhotonNetwork.player.SetStepState(true); Debug.Log("本地完成一个步骤"); currentState = StepXmlState.Other;; Invoke("DeleySetCheckOther", 2); }
/// <summary> /// 检测其他玩家的步骤 /// </summary> public void CheckOtherPlayer() { bool stepFinish = true; if (!CheckAllIsFinish()) { stepFinish = false; return; } if (stepFinish) { currentState = StepXmlState.FinishOther; } }
/// <summary> /// 检测步骤 /// </summary> public void CheckStep() { bool stepFinish = true; for (int i = 0; i < step_BaseList.Count; i++) { if (!step_BaseList[i].IsFinish()) { stepFinish = false; return; } } if (stepFinish) { currentState = StepXmlState.Finish; } }
/// <summary> /// 下一个步骤 /// </summary> public void NextStep() { stepIndex++; if (stepIndex < stepLength) { PhotonNetwork.player.SetStepState(false); step_CurrPlayerList.Clear(); StartStep(stepList[stepIndex]); currentState = StepXmlState.Run; step_Animation.PlayAnimation("Begin"); } else { currentState = StepXmlState.End; Debug.Log("所有的步骤结束了"); } Debug.Log("NextStep"); }
// Use this for initialization void Start() { currentState = StepXmlState.None; step_Animation = GetComponent <StepXmlAnimationManager>(); }
public void FinishOtherStep() { currentState = StepXmlState.Wait; Debug.Log("网络同步完成一个步骤"); }
/// <summary> /// 增加延迟修改状态,避免多客户端数据同步延迟的问题 /// </summary> void DeleySetCheckOther() { Debug.Log("等待2秒后"); currentState = StepXmlState.CheckOther; }