You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.4 KiB
50 lines
1.4 KiB
using System.Collections; |
|
using System.Collections.Generic; |
|
using AX.Network.Protocols; |
|
using AX.Serialization; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
public class DISASTER_EDITOR_RIGHT_SYNC : NetworkMessageBehaviour |
|
{ |
|
private Toggle toggle; |
|
public List<Selectable> toolsUI; |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
var editorRightStruct = message.Body.Deserialize<EditorRightStruct>(); |
|
if (editorRightStruct.disasterID == DisasterManager.disaster.Id) |
|
{ |
|
toggle.interactable = !editorRightStruct.controlRight; |
|
SetInteractable(toggle.interactable); |
|
} |
|
} |
|
// Use this for initialization |
|
void Start () |
|
{ |
|
toggle = GetComponent<Toggle>(); |
|
} |
|
|
|
// Update is called once per frame |
|
void Update () { |
|
|
|
} |
|
private void hideWindow() |
|
{ |
|
TeamNameSetting.GetInstance.Close(); |
|
if(GameObject.Find("WeatherSettingPanel")!=null) |
|
GameObject.Find("WeatherSettingPanel").GetComponent<WeatherSettingManager>().TianQiCancelBtnClick(); |
|
if (GameObject.Find("TheTipWindow")) |
|
{ |
|
GameObject.Find("TheTipWindow").GetComponent<TipWindowManager>().DestroyWindow(); |
|
} |
|
|
|
} |
|
public void SetInteractable(bool value) |
|
{ |
|
for (int i = 0; i < toolsUI.Count; i++) |
|
{ |
|
toolsUI[i].interactable = toggle.interactable; |
|
} |
|
hideWindow(); |
|
} |
|
}
|
|
|