void OnMapClick_MoveArmy(Coords coords) { switch (main.instance.game.gameMode) { case (GameMode.moveArmyFrom): ArmyCountDialog.ShowDilog(this); ArmyCountDialog.SetValue("" + main.instance.context.GetLong("/map/islands/army/[{0}]", Library.Map_GetIslandByPoint(main.instance.context, coords.x, coords.y))); //TODO никак не учитывается, что можно попасть и в море main.instance.game.gameMode = GameMode.moveArmyTo; move_army_from_coords = coords; break; case (GameMode.moveArmyTo): main.instance.SendSrv(Cyclades.Game.Client.Messanges.MoveArmy(Library.Map_GetIslandByPoint(main.instance.context, move_army_from_coords.x, move_army_from_coords.y), Library.Map_GetIslandByPoint(main.instance.context, coords.x, coords.y), move_army_count)); Shmipl.Base.Messenger <Coords> .RemoveListener("Shmipl.Map.Click", OnMapClick_MoveArmy); main.instance.game.gameMode = GameMode.simple; break; } }
void Awake() { instance = FindObjectOfType <ArmyCountDialog>(); }