using AX.MessageSystem; using System.Collections; using System.Collections.Generic; using UnityEngine; using System; using UnityEngine.UI; public class FireDeployLeftSYNCHandle : MonoBehaviour { public FireDepolySYNCInfo fireDepolySYNCInfo; private void Awake() { MessageDispatcher.AddListener("FDLEFTSYNC_HANDLE", FDLeftSYNCHandle); } // Use this for initialization void Start () { } private void OnDestroy() { MessageDispatcher.RemoveListener("FDLEFTSYNC_HANDLE", FDLeftSYNCHandle); } // Update is called once per frame void Update () { } private void FDLeftSYNCHandle(IMessage obj) { var fireDeployLeftSYNCData = (FireDeployLeftSYNCData)obj.Data; if (transform.Find("Label").GetComponent().text == fireDeployLeftSYNCData.modeItemName) { transform.GetComponent().isOn = fireDeployLeftSYNCData.selected; } } }