void Start() { ZeldaVRSettings s = ZeldaVRSettings.Instance; InitOverworldMap(s.overworldWidthInSectors, s.overworldHeightInSectors); InitDungeonMap(s.dungeonWidthInSectors, s.dungeonHeightInSectors); }
void InitFromSettings(ZeldaVRSettings s) { _blockHeight = s.blockHeight; _blockHeightVariance = s.blockHeightVariance; _shortBlockHeight = s.shortBlockHeight; _flatBlockHeight = s.flatBlockHeight; _tileMapWidth_WithoutFiller = s.tileMapWidthInTiles_WithoutFiller; }
public void InitFromSettings(ZeldaVRSettings s) { _sectorWidthInTiles = s.overworldSectorWidthInTiles; _sectorHeightInTiles = s.overworldSectorHeightInTiles; _sectorsWide = s.overworldWidthInSectors; _sectorsHigh = s.overworldHeightInSectors; _tileMapData.InitFromSettings(s); _tileMapTexture.InitFromSettings(s); }
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"); }
void InitFromSettings(ZeldaVRSettings s) { _shortBlockHeight = s.shortBlockHeight; }
public void InitFromSettings(ZeldaVRSettings s) { _tilesWide = s.overworldWidthInTiles; _tilesHigh = s.overworldHeightInTiles; }
public void InitFromSettings(ZeldaVRSettings s) { _tileWidth = s.tileMapTileWidthInPixels; _tileHeight = s.tileMapTileHeightInPixels; _sideLengthInTiles = s.tileMapSideLengthInTiles; }