public static LuaItem CloneLuaItem(LuaItem template, Action <LuaItem> callBack) { var luaItem = CachedClone.Clone(template.gameObject).GetComponent <LuaItem>(); if (callBack != null) { callBack(luaItem); } return(luaItem); }
LuaItem AddItem() { var item = CachedClone.Clone(template.gameObject).GetComponent <LuaItem>(); item.Index = items.Count; item.transform.SetAsLastSibling(); items.Add(item); var clickHandler = item.GetComponent <ClickHandler>(); if (clickHandler != null) { clickHandler.onClick = () => { onClick(item.Index); }; } OnItemAdd(items.Count, item); return(item); }
public void Destroy() { Debug.Log("destroy"); CachedClone.RemoveClone(Hint); }
public HintArrowTarget(Transform target, GameObject template) { Hint = CachedClone.Clone(template); Target = target; }