public unsafe override void LoadFromBuffer(FakeStruct fake, Initializer initializer) { ScrollInfo *info = (ScrollInfo *)fake.ip; minBox = info->minBox; scrollType = info->scrollType; int id = info->Slider; if (id != 0) { if (initializer != null) { initializer.AddContextAction(ContextAction, id); } } }
/// <summary> /// 初始化 /// </summary> /// <param name="mod">模型数据</param> /// <param name="script">主体元素</param> public override void Initial(FakeStruct mod, UIElement script, Initializer initializer) { base.Initial(mod, script, initializer); Main = script.transform; SetItemMod("Item"); HGUIManager.GameBuffer.RecycleChild(script.gameObject); var ex = UITransfromLoader.GetCompositeData(mod); if (ex != null) { if (initializer != null) { initializer.AddContextAction((trans) => { var ele = trans.GetComponent <UIElement>(); if (ele != null) { Slider = ele.composite as UISlider; } }, ex[3]); } } }