Exemplo n.º 1
0
    void Start()
    {
        ZeldaVRSettings s = ZeldaVRSettings.Instance;

        InitOverworldMap(s.overworldWidthInSectors, s.overworldHeightInSectors);
        InitDungeonMap(s.dungeonWidthInSectors, s.dungeonHeightInSectors);
    }
Exemplo n.º 2
0
 void InitFromSettings(ZeldaVRSettings s)
 {
     _blockHeight                = s.blockHeight;
     _blockHeightVariance        = s.blockHeightVariance;
     _shortBlockHeight           = s.shortBlockHeight;
     _flatBlockHeight            = s.flatBlockHeight;
     _tileMapWidth_WithoutFiller = s.tileMapWidthInTiles_WithoutFiller;
 }
Exemplo n.º 3
0
    public void InitFromSettings(ZeldaVRSettings s)
    {
        _sectorWidthInTiles  = s.overworldSectorWidthInTiles;
        _sectorHeightInTiles = s.overworldSectorHeightInTiles;
        _sectorsWide         = s.overworldWidthInSectors;
        _sectorsHigh         = s.overworldHeightInSectors;

        _tileMapData.InitFromSettings(s);
        _tileMapTexture.InitFromSettings(s);
    }
Exemplo n.º 4
0
    static void CreateOverworldUniblockPrefabs()
    {
        GameObject prefab = Selection.activeObject as GameObject;

        ZeldaVRSettings s      = ZeldaVRSettings.Instance;
        int             total  = 0;
        int             hexNum = 0;
        int             yMin   = s.tileMapSideLengthInTiles - s.tileMapHeightInTiles_WithoutFiller;

        for (int y = s.tileMapSideLengthInTiles - 1; y >= yMin; y--)
        {
            for (int x = 0; x < s.tileMapWidthInTiles_WithoutFiller; x++)
            {
                total++;

                string blockName = "block_" + total;
                string path      = BLOCKS_FOLDER + "/" + blockName + ".prefab";

                GameObject clone = PrefabUtility.CreatePrefab(path, prefab);
                Voxel      v     = clone.GetComponent <Voxel>();

                hexNum  = x + (s.tileMapSideLengthInTiles - 1 - y) * s.tileMapSideLengthInTiles;
                v.VName = (hexNum).ToString("X2");  // (hex format)

                v.VTransparency = Transparency.solid;
                v.VColliderType = ColliderType.cube;

                if (v.VTexture.Length == 0)
                {
                    v.VTexture = new Vector2[1];
                }
                v.VTexture[0] = new Vector2(x, y);
            }
        }

        print("Created " + total + " blocks");
    }
Exemplo n.º 5
0
 void InitFromSettings(ZeldaVRSettings s)
 {
     _shortBlockHeight = s.shortBlockHeight;
 }
Exemplo n.º 6
0
 public void InitFromSettings(ZeldaVRSettings s)
 {
     _tilesWide = s.overworldWidthInTiles;
     _tilesHigh = s.overworldHeightInTiles;
 }
Exemplo n.º 7
0
 public void InitFromSettings(ZeldaVRSettings s)
 {
     _tileWidth         = s.tileMapTileWidthInPixels;
     _tileHeight        = s.tileMapTileHeightInPixels;
     _sideLengthInTiles = s.tileMapSideLengthInTiles;
 }