Ejemplo n.º 1
0
        public override DrawGeometryBase Deserialize(DrawingCanvas drawingCanvas)
        {
            var draw = new LineDrawTool(drawingCanvas);

            draw.DeserializeFrom(this);
            return(draw);
        }
Ejemplo n.º 2
0
    private void HighlightTiles(Vector2 mousePos)
    {
        Ray mouseRay = Camera.main.ScreenPointToRay(mousePos);

        GameObject underMouse;
        RaycastHit hitInfo;

        if (Physics.Raycast(mouseRay, out hitInfo))
        {
            underMouse = hitInfo.collider.gameObject;

            IndoorTile tile;
            if (TryGetTile(underMouse, out tile))
            {
                LineDrawTool.DrawBox(underMouse.transform.position, Vector3.one * 5.05f, Color.green);
            }
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        IndoorTileMapData tileMapData = new IndoorTileMapData();

        tileMapData.name         = TEST_MAP_NAME;
        tileMapData.width        = 16;
        tileMapData.height       = 16;
        tileMapData.tileSet      = 0;
        tileMapData.ambientLight = new Vector3(0.2f, 0.2f, 0.2f);
        tileMapData.skyColor     = new Vector3(0f, 0f, 0f);

        tileMapData.tiles = IndoorTileMapData.CreateRandomTiles(tileMapData.width, tileMapData.height);

        GameObject go = new GameObject("tile_map");

        _tileMap = go.AddComponent <IndoorTileMap>();

        _tileMap.Initialize(tileMapData, tilePrefabLib);

        LineDrawTool.EnsureExistance();
    }