Esempio n. 1
0
        public static LuaItem CloneLuaItem(LuaItem template, Action <LuaItem> callBack)
        {
            var luaItem = CachedClone.Clone(template.gameObject).GetComponent <LuaItem>();

            if (callBack != null)
            {
                callBack(luaItem);
            }

            return(luaItem);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public HintArrowTarget(Transform target, GameObject template)
 {
     Hint   = CachedClone.Clone(template);
     Target = target;
 }