示例#1
0
 private void GoToTile(ITileView oldSelectedTile, ITileView newSelectedTile)
 {
     if (newSelectedTile != null)
     {
         _stateController.MoveUnit(Context.selectedUnit.State, newSelectedTile.State.coordinates);
     }
 }
    public void OnItemSelected(ITileView tile, GameObject tileGameObject)
    {
        _currentTile = tile;
        BuildingModel data = tile.ContentModel as BuildingModel;

        _toggleMenu.ToggleMenu();
        SharedModels.GetWriteableModel <SharedDataModel>().SelectedBuilding.Value = data;
    }
示例#3
0
 public void Initialize(ITileModel model, Action <int, int> OnClick = null)
 {
     Model         = model;
     UncoverAction = OnClick;
     View          = GetComponent <TileView>();
     View.Initialize(this);
     View.SetSymbol(Model.Symbol);
 }
示例#4
0
        private void InitializeTile(ITileView tileInfo)
        {
            if (_initializedIndexes.Contains(tileInfo.ViewPosition))
            {
                return;
            }

            switch (tileInfo.Type)
            {
            case MapTileType.Cube:
            {
                _mapViewController.InitializeCube(tileInfo.ViewPosition);
                break;
            }

            case MapTileType.Plane:
            {
                _mapViewController.InitializePlane(tileInfo.ViewPosition);
                break;
            }

            case MapTileType.Square:
            {
                _mapViewController.InitializeSquare(tileInfo.ViewPosition);
                break;
            }

            case MapTileType.Empty:
            {
                _mapViewController.InitializeEmpty(tileInfo.ViewPosition);
                break;
            }
            }

            _initializedIndexes.Add(new IntVector2(tileInfo.ViewPosition.x, tileInfo.ViewPosition.y));
        }
示例#5
0
 private void UpdateHover(ITileView oldTile, ITileView newTile)
 {
     UpdateHoverHighlighting(oldTile, newTile);
 }