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 toolsUI; protected override void Execute(BinaryMessage message) { var editorRightStruct = message.Body.Deserialize(); if (editorRightStruct.disasterID == DisasterManager.disaster.Id) { toggle.interactable = !editorRightStruct.controlRight; SetInteractable(toggle.interactable); } } // Use this for initialization void Start () { toggle = GetComponent(); } // Update is called once per frame void Update () { } private void hideWindow() { TeamNameSetting.GetInstance.Close(); if(GameObject.Find("WeatherSettingPanel")!=null) GameObject.Find("WeatherSettingPanel").GetComponent().TianQiCancelBtnClick(); if (GameObject.Find("TheTipWindow")) { GameObject.Find("TheTipWindow").GetComponent().DestroyWindow(); } } public void SetInteractable(bool value) { for (int i = 0; i < toolsUI.Count; i++) { toolsUI[i].interactable = toggle.interactable; } hideWindow(); } }