Exemplo n.º 1
0
		public static void add(string name, ELevelSize size, ELevelType type)
		{
			if (!ReadWrite.folderExists("/Maps/" + name))
			{
				ReadWrite.createFolder("/Maps/" + name);
				Block block = new Block();
				block.writeByte(Level.SAVEDATA_VERSION);
				block.writeSteamID(Provider.client);
				block.writeByte((byte)size);
				block.writeByte((byte)type);
				ReadWrite.writeBlock("/Maps/" + name + "/Level.dat", false, block);
				ReadWrite.copyFile("/Bundles/Level/Charts.unity3d", "/Maps/" + name + "/Charts.unity3d");
				ReadWrite.copyFile("/Bundles/Level/Details.unity3d", "/Maps/" + name + "/Terrain/Details.unity3d");
				ReadWrite.copyFile("/Bundles/Level/Details.dat", "/Maps/" + name + "/Terrain/Details.dat");
				ReadWrite.copyFile("/Bundles/Level/Materials.unity3d", "/Maps/" + name + "/Terrain/Materials.unity3d");
				ReadWrite.copyFile("/Bundles/Level/Materials.dat", "/Maps/" + name + "/Terrain/Materials.dat");
				ReadWrite.copyFile("/Bundles/Level/Resources.dat", "/Maps/" + name + "/Terrain/Resources.dat");
				ReadWrite.copyFile("/Bundles/Level/Lighting.dat", "/Maps/" + name + "/Environment/Lighting.dat");
				ReadWrite.copyFile("/Bundles/Level/Roads.unity3d", "/Maps/" + name + "/Environment/Roads.unity3d");
				ReadWrite.copyFile("/Bundles/Level/Roads.dat", "/Maps/" + name + "/Environment/Roads.dat");
				ReadWrite.copyFile("/Bundles/Level/Ambience.unity3d", "/Maps/" + name + "/Environment/Ambience.unity3d");
				if (Level.onLevelsRefreshed != null)
				{
					Level.onLevelsRefreshed();
				}
			}
		}
Exemplo n.º 2
0
		public static void remove(string name)
		{
			ReadWrite.deleteFolder("/Maps/" + name);
			if (Level.onLevelsRefreshed != null)
			{
				Level.onLevelsRefreshed();
			}
		}