/// <summary> /// 使用数据创建Tree /// </summary> public void CreateByData(string treeName, RectTransform parentTrm, RectTransform treeRootTrm, float offx, float offy, byte[] data) { Name = treeName; IoBuffer ib = new IoBuffer(); ib.PutBytes(data); bool bFolder = ib.GetBool(); //这里第一个节点一定是根节点,但是还是按正常数据读下 string name = ib.GetString(); int listSize = ib.GetInt(); //VLog.I("TreeContainer","CreateByData","bFolder:"+bFolder+" name:"+name+" listSize:"+listSize); //这里需要创建 TreeRootTrm = treeRootTrm; RootFolder = TreeFolder.CreateRootFolder(treeName, parentTrm, this, offx, offy); for (int i = 0; i < listSize; i++) { //CreateOneItem(ib); bFolder = ib.GetBool(); if (bFolder) { RootFolder.AddFolderByData(ib); } else { RootFolder.AddItemByData(ib); } } }
public override void Deserialize(IoBuffer input, ISerializationContext context) { LotLocation_X = input.GetUInt16(); LotLocation_Y = input.GetUInt16(); Name = input.GetPascalString(); StartFresh = input.GetBool(); MayorMode = input.GetBool(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { NominationMode = input.GetBool(); int candCount = input.GetInt32(); Candidates = new List <NhoodCandidate>(); for (int i = 0; i < candCount; i++) { var candidate = new NhoodCandidate() { ID = input.GetUInt32(), Name = input.GetPascalVLCString(), Rating = input.GetUInt32() }; if (!NominationMode) { candidate.LastNhoodName = input.GetPascalVLCString(); candidate.LastNhoodID = input.GetUInt32(); candidate.TermNumber = input.GetUInt32(); candidate.Message = input.GetPascalVLCString(); } Candidates.Add(candidate); } }
/// <summary> /// 使用外部数据填充增加folder /// </summary> /// <param name="ib">Ib.</param> public void AddFolderByData(IoBuffer ib) { bool bFolder = false; string name = ib.GetString(); int listSize = ib.GetInt(); if (!BeFolderOpen) { OpenFolder(); } TreeFolder curTreeFolder = TreeFolder.CreateSubFolder(name, this, MyTreeContainer); for (int i = 0; i < listSize; i++) { //CreateOneItem(ib); bFolder = ib.GetBool(); if (bFolder) { curTreeFolder.AddFolderByData(ib); } else { curTreeFolder.AddItemByData(ib); } } }
public void Deserialize(IoBuffer input, ISerializationContext context) { var count = input.GetUInt32(); Items = new List <Top100Entry>((int)count); for (var i = 0; i < count; i++) { var item = new Top100Entry(); item.Rank = input.Get(); var hasValue = input.GetBool(); if (hasValue) { item.TargetId = input.GetUInt32(); item.TargetName = input.GetPascalVLCString(); } Items.Add(item); } }
public override void Deserialize(IoBuffer input, ISerializationContext context) { UseCst = input.GetBool(); Title = input.GetPascalVLCString(); Message = input.GetPascalVLCString(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { base.Deserialize(input, context); UpdateInstantly = input.GetBool(); }
public override void Deserialize(IoBuffer input, ISerializationContext context) { LotId = input.GetUInt32(); OpenIfClosed = input.GetBool(); }