예제 #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);
        }
예제 #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);
        }
예제 #3
0
 public void Destroy()
 {
     Debug.Log("destroy");
     CachedClone.RemoveClone(Hint);
 }
예제 #4
0
 public HintArrowTarget(Transform target, GameObject template)
 {
     Hint   = CachedClone.Clone(template);
     Target = target;
 }