using System.Collections; using System.Collections.Generic; using UnityEngine; public class SendSubTest : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { Sub2RecordClass selectRecord = XmlHelper.DeserializeObject(Application.streamingAssetsPath+ "/XML/修理所展开/修理所展开科目2022_7_5 11 44 45.xml", typeof(Sub2RecordClass)) as Sub2RecordClass; NetSub2Msg msg = new NetSub2Msg(); msg.recordClass = selectRecord; msg.onboardGO.Add("test", "ssss"); msg.groupLearn = new NetLearnGroup(); XDictionary testDic = new XDictionary(); testDic.Add("dsad", "dads"); byte[] dicBytes = BytesHelper.ClassToBytes>(testDic); XDictionary desDic; desDic = BytesHelper.BytesToClass>(dicBytes); foreach (var item in desDic) { Debug.Log(item.Key); } //byte[] bytes= BytesHelper.ObjectToBytes(msg); //NetSub2Msg newMsg = (NetSub2Msg)BytesHelper.BytesToObject(bytes); EventCenter.Instance.EventTrigger("SubjectDown", selectRecord); } } }