private void SetupTileController(uint orderedIndex, BaseNode node) { HexGridCell <BaseNode> hexGridCell = orderedCells[orderedIndex]; hexGridCell.Value = node; ITileController tileController = orderedControllers[orderedIndex]; TileView tileView = null; if (!tilePrefabMap.TryGetValue(node.GetType(), out var value)) { logger.Error("No tile view prefab mapping exists for type {0}.", node.GetType()); DestroyController(orderedIndex, destroyView: true); return; } if (tileController != null) { if (tileController.ViewType != value.GetType()) { DestroyController(orderedIndex, destroyView: true); } else { tileView = tileController.BaseView; } } if (tileView == null) { tileView = GetTileView(hexGridCell); if (tileView == null) { logger.Error("Failed to get a tile view for node of type {0}", node.Type); return; } } DestroyController(orderedIndex, destroyView: false); tileController = TileControllerFactory.MakeController(tileView, hexGridCell, this); orderedControllers[orderedIndex] = tileController; }
protected virtual void ViewLongPressed(TileView obj) { grid.Console.ShowInspector(Node); }
protected virtual void ViewTapped(TileView view) { }
protected virtual void ViewDeselected(TileView view) { TView view2 = View; view2.Scale = TileSettings.deselectedTileScale; }
protected override void ViewTapped(TileView view) { grid.Console.ShowInspector(base.Node); }