Browse Source

同步化工修改

develop
曹衍涛 4 years ago
parent
commit
58077589b7
  1. 10
      Assets/Scripts/Common/CommandCenter/PowerTransferController.cs
  2. 3
      Assets/Scripts/Common/GameSettings/GameSettings.cs
  3. 5
      Assets/Scripts/Common/Lobby/GET_LOBBY_ROOMLIST_SYNC.cs
  4. 61
      Assets/Scripts/Common/Menu/Menu.cs

10
Assets/Scripts/Common/CommandCenter/PowerTransferController.cs

@ -279,6 +279,7 @@ public class PowerTransferController : MonoBehaviour
}
}
}
StartCoroutine(WaitBtnEnable());
}
if (GameSettings.othersSettings.mode == Mode.Practice)
@ -372,8 +373,15 @@ public class PowerTransferController : MonoBehaviour
//发送给房间内各个客服端调派车辆数据,作战部署力量列表用
NetworkManager.Default.SendAsync("FIREDEPLOY_ENGINES_SYNC",
new KeyValuePair<string, List<KeyValuePair<FireCarEngine, int>>>(NowSelectUser.Org.DisplayName, powers));
StartCoroutine(WaitBtnEnable());
}
IEnumerator WaitBtnEnable()
{
SureBtn.GetComponent<Button>().interactable = false;
LoadPromptWin.Instance.LoadTextPromptWindow("调派完成", 1f);
yield return new WaitForSeconds(1f);
SureBtn.GetComponent<Button>().interactable = true;
}
public void Cancel()
{
hintWin.SetActive(false);

3
Assets/Scripts/Common/GameSettings/GameSettings.cs

@ -20,6 +20,9 @@ public static class GameSettings
public class OthersSettings
{
public SceneType SceneType = SceneType.None;
public string mapname;
public Mode mode = Mode.None;
public bool startRecord = false;//先默认初始化为true,没做新建节点时好测试记录回放

5
Assets/Scripts/Common/Lobby/GET_LOBBY_ROOMLIST_SYNC.cs

@ -49,10 +49,15 @@ public class GET_LOBBY_ROOMLIST_SYNC : NetworkMessageBehaviour
Destroy(t.gameObject);
}
foreach (Room r in roomList)
{
if (r.Map.name == GameSettings.othersSettings.mapname &&
r.Map.sceneType == GameSettings.othersSettings.SceneType)
{
GameObject room = Instantiate(RoomPrefab, RoomParent);
room.GetComponent<RoomManager>().MyRoom = r;
room.name = "房间" + r.Id;
}
}
}
}

61
Assets/Scripts/Common/Menu/Menu.cs

@ -5,8 +5,10 @@ using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using AX.NetworkSystem;
using System.Xml;
public class Menu : MonoBehaviour {
public class Menu : MonoBehaviour
{
public Toggle DrillToggle;
public Toggle ExerciseToggle;
public Toggle VideoToggle;
@ -31,7 +33,8 @@ public class Menu : MonoBehaviour {
public Text promptText;
void Start () {
void Start()
{
DrillToggle.onValueChanged.AddListener(DrillToggleChange);
ExerciseToggle.onValueChanged.AddListener(ExerciseToggleChange);
VideoToggle.onValueChanged.AddListener(VideoToggleChage);
@ -42,6 +45,7 @@ public class Menu : MonoBehaviour {
SureButton.onClick.AddListener(Sure);
CancelButton.onClick.AddListener(Cancel);
oritextColor = DrillToggle.GetComponentInChildren<Text>().color;
GetMaps();
}
private void Cancel()
@ -166,4 +170,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);
}
}
}

Loading…
Cancel
Save