本文整理汇总了C#中Map.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Map.Init方法的具体用法?C# Map.Init怎么用?C# Map.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.Init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenMap0
void GenMap0()
{
Map map = new Map();
map.Init();
//扰乱边缘
NoisyEdges noisyEdge = new NoisyEdges();
noisyEdge.BuildNoisyEdges(map);
new MapTexture(TextureScale).AttachTexture(GameObject.Find("Map"), map, noisyEdge);
}
示例2: GenMap
private void GenMap()
{
Random.seed = 1;
_txtTexture = GetTextTexture();
Map.Width = Width;
Map.Height = Height;
Map map = new Map();
map.SetPointNum(_pointNum);
map.Init(CheckIsland());
//扰乱边缘
NoisyEdges noisyEdge = new NoisyEdges();
noisyEdge.BuildNoisyEdges(map);
new MapTexture(TextureScale).AttachTexture(_showMap, map, noisyEdge);
}
示例3: Awake
// void Update()
// {
// if (_map != null && _map.SelectedCenter != null)
// {
// _selector.transform.localPosition = new Vector3(_map.SelectedCenter.point.x, _map.SelectedCenter.point.y, 1);
// }
// }
void Awake ()
{
_selector = GameObject.Find("Selector");
//Random.seed = 1;
_map = new Map();
_map.Init();
GameObject.Find("Main MyCamera").GetComponentInChildren<MyCamera>().Map = _map;
//ÈÅÂÒ±ßÔµ
NoisyEdges noisyEdge = new NoisyEdges();
noisyEdge.BuildNoisyEdges(_map);
new MapTexture(_textureScale).AttachTexture(GameObject.Find("Map"), _map,noisyEdge);
}
示例4: Start
IEnumerator Start()
{
InitGlobal();
InitWorld();
InitUI();
//проверка все ли есть на сцене
if (Terrain.activeTerrain==null) { ui.error("ErrorCreateMap", "Terrain"); yield break; }
else if (cam==null) { ui.error("ErrorCreateMap", "Camera"); yield break; }
else if (scene==null) { ui.error("ErrorCreateMap", "Scene"); yield break; }
//инициализация компонентов мира
map = scene.AddComponent<Map>();
players = scene.AddComponent<Players>();
effects = scene.AddComponent<MapEffects>();
controller = scene.AddComponent<WorldController>();
//передача в players tiles
map.EventDataTiles += delegate(MapDataGround.Tile[,] data) {
players.tiles = data;
};
//передача в players zones
map.EventDataZones += delegate(byte[,] data) {
players.zones = data;
};
//подпрограммы инциализаций компонентов
yield return StartCoroutine(map.Init());
yield return StartCoroutine(players.Init());
yield return StartCoroutine(effects.Init());
yield return StartCoroutine(controller.Init());
CreateMe();
yield break;
}
示例5: Save
private void Save()
{
BusyContent = "Создание карты транспортной сети...";
IsBusy = true;
BackgroundWorker worker = new BackgroundWorker();
worker.RunWorkerCompleted += (s, e) =>
{
DialogResult = true;
IsBusy = false;
CloseView = true;
};
worker.DoWork += (s, e) =>
{
Map = new Map();
foreach (LayerViewModel lvm in Layers)
{
var maskInfo = new Dictionary<string, byte>();
foreach (var pair in lvm.MaskInfo)
{
maskInfo.Add(pair.Key, pair.Value);
}
var layer = new Enviroment.Model.Layer(lvm.Name, lvm.MaskSource, lvm.Scale, maskInfo);
Map.Add(layer);
}
Map.Init();
};
worker.RunWorkerAsync();
}