示例#1
0
        public IEnumerator InitCachedItems()
        {
            PrefabResource res = new PrefabResource();

            yield return(ResourceLoader.Instance.load_prefab(UIGOODSITEM, res, true));

            GameObject obj = res.obj_;

            obj.name = obj.name.Replace("(Clone)", "");

            UIItemNewSlot.Bind(obj);

            obj.SetActive(false);
            cachedItems = new TemplateCache();
            cachedItems.Init(obj, "UINewGoodsItem", 0, this.root, 50);

            obj.transform.SetParent(cachedItems.root.transform, false);

            obj.transform.localPosition = new Vector3();
            obj.transform.localScale    = Vector3.one;
            obj.transform.localRotation = new Quaternion();

            cachedItems.AddGameObjects(30);
        }