This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void InitHeights() | |
{ | |
HeightField = new int[Width * Height]; | |
for (int y = 0; y < Height; ++y) | |
{ | |
for (int x = 0; x < Width; ++x) | |
{ | |
// Compute a position in noise space | |
float noiseX = (float)x / Width * NoiseFrequency; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class MapBuilder1 : MapBuilder | |
{ | |
public int FeatureChance = 30; | |
public string[] TileLoadStrings; | |
public string[] FeatureLoadStrings; | |
protected override void InitMapObjects() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Xml; | |
using System.Xml.Serialization; | |
[XmlRoot] | |
public sealed class TileInfo : DatabaseEntry | |
{ | |
[XmlElement] | |
public int Height { get; private set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Database> | |
<!-- Tile Infos --> | |
<TileInfo ID="TILE_WATER"> | |
<Height>0</Height> | |
<FeatureChance>0</FeatureChance> | |
<PrefabPath>Tiles/TileWater</PrefabPath> | |
</TileInfo> | |
<TileInfo ID="TILE_GRASS"> | |
<Height>1</Height> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class MapBuilder2 : MapBuilder | |
{ | |
protected override void InitMapObjects() | |
{ | |
for (int y = 0; y < Height; ++y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get all tiles in the database that match the height | |
TileInfo[] tileInfos = Database.Instance.GetEntries<TileInfo>().Where((info) => info.Height == height).ToArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Serialization; | |
using System.Runtime; | |
using System.Runtime.Serialization; | |
using System.Linq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Serialization; | |
using System.Reflection; | |
public delegate DatabaseEntry DatabaseEntryFactoryDelegate (XmlReader reader); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Xml; | |
using System.Xml.Schema; | |
using System.Xml.Serialization; | |
public class ID | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.IO; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Serialization; | |
[XmlRoot("AssetBundleInfo")] | |
public sealed class AssetBundleInfo : DatabaseEntry | |
{ |
OlderNewer