//запуск корутины движения public virtual void move(NetworkStreetPath path) { if (StepsInJail == 0) { if (!isMoving && !corutine) { corutine = true; way = _dbWork.GetWay(currentStreetPath.GetIdStreetPath(), path.GetIdStreetPath()); if (currentSteps + way.Count > maxSteps && !isGonnaBeCathced && !alreadyCheat) { NetworkGameController.aboutPlayer += "Игрок " + NickName + " пытается смухлевать" + "\n"; _gameCanvas.OpenWarningWindow(this); isCheating = true; } _gameCanvas.OnOffSavedButtons(); StartCoroutine(Go()); } } else { _gameCanvas.ShowInfoAboutEvent("Вы заключены под стражу" + "\n" + "Осталось ходов: " + StepsInJail); } }
//при клике на какую-нибудь улицу void MouseOver_Street(GameObject ourHitObject) { if (ourHitObject.GetComponent <StreetPath>() != null) { if (Input.GetMouseButton(0) && canMove && _dBwork.GetPlayerbyId(1).GetCurrentStep() && Cameras.mode != 1) { canMove = false; _dBwork.GetPlayerbyId(1).move(ourHitObject.GetComponent <StreetPath>()); } else if (Input.GetMouseButton(0) && canMove && _dBwork.GetPlayerbyId(1).GetCurrentStep() && Cameras.mode == 1) { if (_dBwork.GetWay(_dBwork.GetPlayerbyId(1).CurrentStreetPath.GetIdStreetPath(), ourHitObject.GetComponent <StreetPath>().GetIdStreetPath()).Count == 1) { canMove = false; _dBwork.GetPlayerbyId(1).move(ourHitObject.GetComponent <StreetPath>()); } } else if (Input.GetMouseButton(1) && Cameras.mode != 1) { // показать информацию о улице selectedStreetPath = ourHitObject.GetComponent <StreetPath>(); } else if (!Input.GetMouseButton(0)) { canMove = true; } } else { if (Input.GetMouseButton(0) && canMove && _networkDBwork.GetPlayer().GetCurrentStep() && Cameras.mode != 1) { canMove = false; _networkDBwork.GetPlayer().move(ourHitObject.GetComponent <NetworkStreetPath>()); } else if (Input.GetMouseButton(0) && canMove && _networkDBwork.GetPlayer().GetCurrentStep() && Cameras.mode == 1) { if (_networkDBwork.GetWay(_networkDBwork.GetPlayer().CurrentStreetPath.GetIdStreetPath(), ourHitObject.GetComponent <NetworkStreetPath>().GetIdStreetPath()).Count == 1) { canMove = false; _networkDBwork.GetPlayer().move(ourHitObject.GetComponent <NetworkStreetPath>()); } } else if (Input.GetMouseButton(1) && Cameras.mode != 1) { // показать информацию о улице //selectedStreetPath = ourHitObject.GetComponent<StreetPath>(); } else if (!Input.GetMouseButton(0)) { canMove = true; } } }