public static GameObject create(int prop_id, BagPanelScript parentScript) { GameObject prefab = Resources.Load("Prefabs/UI/Panel/PropDetailPanel") as GameObject; GameObject obj = GameObject.Instantiate(prefab, GameObject.Find("Canvas_Middle").transform); obj.GetComponent <PropDetailPanelScript>().setPropId(prop_id); obj.GetComponent <PropDetailPanelScript>().m_parentScript = parentScript; return(obj); }
// Use this for initialization void Start() { OtherData.s_bagPanelScript = this; // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc("BagPanelScript_hotfix", "Start")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke("HotFix_Project.BagPanelScript_hotfix", "Start", null, null); return; } if (Instance == null) { Instance = this; } uiWarpContent = gameObject.transform.GetComponentInChildren <UIWarpContent>(); uiWarpContent.onInitializeItem = onInitializeItem; // 拉取背包数据 if (!m_isFromGameLayer) { LogicEnginerScript.Instance.GetComponent <GetUserBagRequest>().CallBack = onReceive_GetUserBag; LogicEnginerScript.Instance.GetComponent <GetUserBagRequest>().OnRequest(); } else { UpdateUI(); if (UserData.propData.Count == 0) { NoProp.transform.localScale = Vector3.one; } else { NoProp.transform.localScale = Vector3.zero; } } }