Exemplo n.º 1
0
		public void GenerateFullMap(MapParameters mapParameters, FullMapParameters fullMapParameters)
		{
			if (startedGeneration)
			{
				Debug.LogError("Geracao ja iniciada, aguarde");
				return;
			}
			
			if (mapParameters.useMeshColor)
			{
				mapParameters.textureResolutionFactor = 1;
			}
			
			GameObject mapGameObject;
			if (OverrideMesh)
			{
				mapGameObject = GameObject.Find(MapParentName);
				if (mapGameObject)
					DestroyImmediate(mapGameObject);
				mapGameObject = new GameObject(MapParentName);
			}
			else
			{
				mapGameObject = new GameObject();
				mapGameObject.name = MapParentName + " " + mapGameObject.GetInstanceID();
			}

			var fullMapGenerator = mapGameObject.AddComponent<FullMapGenerator>();
			fullMapGenerator.ProgressBarAddAction = ProgressBarAddAction;
			fullMapGenerator.SetGenerator(mapParameters, fullMapParameters);
			fullMapGenerator.StartGeneration();
			
			startedGeneration = true;
		}
Exemplo n.º 2
0
		public void UpdateProfile()
		{
			if (mapProfile && !OverrideProfile)
			{
				var mapProperties = mapProfile as MapProperties;
				parameters = mapProperties.MapParameters;
				fullMapParameters = mapProperties.FullMapParameters;
			}
		}
Exemplo n.º 3
0
		public void SetGenerator(MapParameters mapParameters, FullMapParameters fullMapParameters)
		{
			_mapParameters = mapParameters;
			_fullMapParameters = fullMapParameters;
			
			_mapParent = GameObject.Find(MapParentName);
			_mapGenerator = FindObjectOfType<MapGenerator>();
			_fullMapSize = _fullMapParameters.fullMapSize * (_mapParameters.size - 1) + 1;
			
			GeneratorIsSet = true;
		}