Exemple #1
0
        private void CreateBag()
        {
            var objres = ResourceManager.PrepareResourceSync <GameObject>("UI/BackPack.prefab");
            var obj    = Instantiate(objres) as GameObject;

            if (null != BackPackRoot && obj != null)
            {
                var objTransform = obj.transform;
                //objTransform.parent = BackPackRoot;
                objTransform.SetParentEX(BackPackRoot);
                objTransform.localScale    = Vector3.one;
                objTransform.localPosition = Vector3.zero;
                obj.SetActive(true);

                backPack = obj.GetComponent <BagFrame>();
//              if (backPack)
//              {
//                  backPack.AddBindEvent();
//              }
            }
        }