public static bool AllowUserActivity; // Разрешено действие пользователя // Use this for initialization void Start() { GameState = enumGameState.BeginGame; _score1 = 0; _score2 = 0; this.ChangeBorderPlace(); _tm = GameObject.Find("txtMessage").GetComponent <MessageControl> (); _tm.RaiseMessage("Start !", 2, Color.magenta); _curC = GameObject.Find("FireShoot").GetComponent <CursorController> (); _ply1 = GameObject.Find("meshPlayer1"); _ply2 = GameObject.Find("meshPlayer2"); _ply1.GetComponent <TankController> ().UnderAIControl = GameStatic.LeftPlayer.isAI; _ply2.GetComponent <TankController> ().UnderAIControl = GameStatic.RightPlayer.isAI; _actTC = _ply1.GetComponent <TankController> (); _ply1.GetComponent <TankController> ().player = GameStatic.LeftPlayer; _ply2.GetComponent <TankController> ().player = GameStatic.RightPlayer; AllowUserActivity = true; RightPlayerGameField = new Rect(3.5f, -10.5f, 19.5f, 22.5f); // Ограничения по полю передвижения танков UpdatePlayers(); //Обновляем имена игроков }
// Попадание в танк private void TankHit(Player player) { if (player.Side == enumBoardSide.Right) { _score1++; Debug.Log("Player " + player.Name + " Hit"); _tm.RaiseMessage("Player " + player.ToString() + " Hit", 3, Color.magenta); } else if (player.Side == enumBoardSide.Left) { _score2++; Debug.Log("Player " + player.Name + " Hit"); _tm.RaiseMessage("Player " + player.ToString() + " Hit", 3, Color.magenta); } this.UpdateScore(); }