private void CheckTouchOrder(NotifyParam obj) { List <int> touchOrder = gameModel.TouchOrder; bool check = true; for (int i = 0; i < touchOrder.Count; i++) { if (touchOrder[i] != clientTouchOrder[i]) { check = false; break; } } clientTouchOrder = new List <int>(); TurnMessageParam turnMessageParam = new TurnMessageParam(); turnMessageParam.isCorrect = check; if (check) { turnMessageParam.message = "WELL DONE!!!"; } else { gameModel.Life--; turnMessageParam.message = "SORRY!!!"; } dispatcher.Dispatch(GameEvents.SHOW_TURN_MESSAGE, turnMessageParam); }
private void ShowTurnMessage(NotifyParam obj) { TurnMessageParam param = obj.data as TurnMessageParam; _viewComp.turnMessageTxt.text = param.message; _viewComp.turnMessageTxt.enabled = true; //_viewComp.enabled = true; _panel.SetActive(true); }
private void CheckTouchOrder(NotifyParam obj) { List<int> touchOrder = gameModel.TouchOrder; bool check = true; for (int i = 0; i < touchOrder.Count; i++) { if (touchOrder[i] != clientTouchOrder[i]) { check = false; break; } } clientTouchOrder = new List<int>(); TurnMessageParam turnMessageParam = new TurnMessageParam(); turnMessageParam.isCorrect = check; if (check) { turnMessageParam.message = "WELL DONE!!!"; } else { gameModel.Life--; turnMessageParam.message = "SORRY!!!"; } dispatcher.Dispatch(GameEvents.SHOW_TURN_MESSAGE, turnMessageParam); }