|
|
@ -5,19 +5,21 @@ using UnityEngine; |
|
|
|
using UnityEngine.UI; |
|
|
|
using UnityEngine.UI; |
|
|
|
using UnityEngine.SceneManagement; |
|
|
|
using UnityEngine.SceneManagement; |
|
|
|
using AX.NetworkSystem; |
|
|
|
using AX.NetworkSystem; |
|
|
|
|
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
|
|
|
|
public class Menu : MonoBehaviour { |
|
|
|
public class Menu : MonoBehaviour |
|
|
|
|
|
|
|
{ |
|
|
|
public Toggle DrillToggle; |
|
|
|
public Toggle DrillToggle; |
|
|
|
public Toggle ExerciseToggle; |
|
|
|
public Toggle ExerciseToggle; |
|
|
|
public Toggle VideoToggle; |
|
|
|
public Toggle VideoToggle; |
|
|
|
public Toggle DisaterToggle; |
|
|
|
public Toggle DisaterToggle; |
|
|
|
public Toggle SysSettingToggle; |
|
|
|
public Toggle SysSettingToggle; |
|
|
|
public Toggle HelpToggle; |
|
|
|
public Toggle HelpToggle; |
|
|
|
public Button ExitButton; |
|
|
|
public Button ExitButton; |
|
|
|
public GameObject Hint; |
|
|
|
public GameObject Hint; |
|
|
|
public Text ShowText; |
|
|
|
public Text ShowText; |
|
|
|
|
|
|
|
|
|
|
|
public Button SureButton; |
|
|
|
public Button SureButton; |
|
|
|
public Button CancelButton; |
|
|
|
public Button CancelButton; |
|
|
|
|
|
|
|
|
|
|
|
public GameObject SettingPanel; |
|
|
|
public GameObject SettingPanel; |
|
|
@ -30,8 +32,9 @@ public class Menu : MonoBehaviour { |
|
|
|
private Color oritextColor; |
|
|
|
private Color oritextColor; |
|
|
|
|
|
|
|
|
|
|
|
public Text promptText; |
|
|
|
public Text promptText; |
|
|
|
|
|
|
|
|
|
|
|
void Start () { |
|
|
|
void Start() |
|
|
|
|
|
|
|
{ |
|
|
|
DrillToggle.onValueChanged.AddListener(DrillToggleChange); |
|
|
|
DrillToggle.onValueChanged.AddListener(DrillToggleChange); |
|
|
|
ExerciseToggle.onValueChanged.AddListener(ExerciseToggleChange); |
|
|
|
ExerciseToggle.onValueChanged.AddListener(ExerciseToggleChange); |
|
|
|
VideoToggle.onValueChanged.AddListener(VideoToggleChage); |
|
|
|
VideoToggle.onValueChanged.AddListener(VideoToggleChage); |
|
|
@ -42,6 +45,7 @@ public class Menu : MonoBehaviour { |
|
|
|
SureButton.onClick.AddListener(Sure); |
|
|
|
SureButton.onClick.AddListener(Sure); |
|
|
|
CancelButton.onClick.AddListener(Cancel); |
|
|
|
CancelButton.onClick.AddListener(Cancel); |
|
|
|
oritextColor = DrillToggle.GetComponentInChildren<Text>().color; |
|
|
|
oritextColor = DrillToggle.GetComponentInChildren<Text>().color; |
|
|
|
|
|
|
|
GetMaps(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void Cancel() |
|
|
|
private void Cancel() |
|
|
@ -166,4 +170,57 @@ public class Menu : MonoBehaviour { |
|
|
|
promptText.text = "登录用户没有灾情管理权限"; |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|