|
|
|
@ -5,6 +5,7 @@ using UnityEngine;
|
|
|
|
|
using UnityEngine.UI; |
|
|
|
|
using UnityEngine.SceneManagement; |
|
|
|
|
using AX.NetworkSystem; |
|
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
|
|
public class Menu : MonoBehaviour { |
|
|
|
|
public Toggle DrillToggle; |
|
|
|
@ -42,6 +43,7 @@ public class Menu : MonoBehaviour {
|
|
|
|
|
SureButton.onClick.AddListener(Sure); |
|
|
|
|
CancelButton.onClick.AddListener(Cancel); |
|
|
|
|
oritextColor = DrillToggle.GetComponentInChildren<Text>().color; |
|
|
|
|
GetMaps(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void Cancel() |
|
|
|
@ -166,4 +168,57 @@ public class Menu : MonoBehaviour {
|
|
|
|
|
promptText.text = "登录用户没有灾情管理权限"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void GetMaps() |
|
|
|
|
{ |
|
|
|
|
var doc = new XmlDocument(); |
|
|
|
|
|
|
|
|
|
doc.Load(Application.dataPath + @"\StreamingAssets\MainMapXml.xml"); |
|
|
|
|
|
|
|
|
|
var children = doc.SelectSingleNode("Maps").ChildNodes; |
|
|
|
|
|
|
|
|
|
foreach (XmlElement node in children) |
|
|
|
|
{ |
|
|
|
|
var sceneType = node.GetAttribute("MapType"); |
|
|
|
|
var sceneTp = SceneType.None; |
|
|
|
|
if (sceneType == SceneType.化工建筑.ToString()) |
|
|
|
|
{ |
|
|
|
|
sceneTp = SceneType.化工建筑; |
|
|
|
|
} |
|
|
|
|
else if (sceneType == SceneType.高层建筑.ToString()) |
|
|
|
|
{ |
|
|
|
|
sceneTp = SceneType.高层建筑; |
|
|
|
|
} |
|
|
|
|
else if (sceneType == SceneType.地下建筑.ToString()) |
|
|
|
|
{ |
|
|
|
|
sceneTp = SceneType.地下建筑; |
|
|
|
|
} |
|
|
|
|
else if (sceneType == SceneType.综合体建筑.ToString()) |
|
|
|
|
{ |
|
|
|
|
sceneTp = SceneType.综合体建筑; |
|
|
|
|
} |
|
|
|
|
var mapName = node.GetAttribute("MapName"); |
|
|
|
|
GameSettings.othersSettings.SceneType = sceneTp; |
|
|
|
|
GameSettings.othersSettings.mapname = mapName; |
|
|
|
|
|
|
|
|
|
//var path = node.GetAttribute("Path"); |
|
|
|
|
//var unit = Unit.None; |
|
|
|
|
//if (path == Unit.DongYouLiQing.ToString()) |
|
|
|
|
//{ |
|
|
|
|
// unit = Unit.DongYouLiQing; |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var intro = node.GetAttribute("Intro"); |
|
|
|
|
//var areaSquadron = node.GetAttribute("XiaQZD"); |
|
|
|
|
|
|
|
|
|
//mapType.sceneType = sceneTp; |
|
|
|
|
//mapType.unit = unit; |
|
|
|
|
//mapType.name = mapName; |
|
|
|
|
//mapType.introduction = intro; |
|
|
|
|
//mapType.areaSquadron = areaSquadron; |
|
|
|
|
|
|
|
|
|
//maps.Add(mapType.unit.ToString(), mapType); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|