Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 protected virtual void ViewLongPressed(TileView obj)
 {
     grid.Console.ShowInspector(Node);
 }
Esempio n. 3
0
 protected virtual void ViewTapped(TileView view)
 {
 }
Esempio n. 4
0
        protected virtual void ViewDeselected(TileView view)
        {
            TView view2 = View;

            view2.Scale = TileSettings.deselectedTileScale;
        }
Esempio n. 5
0
 protected override void ViewTapped(TileView view)
 {
     grid.Console.ShowInspector(base.Node);
 }