| | |
| | | public async void Init(int heroID, int skinID, int breakLevel = 0, int star = 0, int awakelv = 0, int lv = 0, bool isShowLock = false) |
| | | { |
| | | await LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | if (this == null) return; |
| | | var heroConfig = HeroConfig.Get(heroID); |
| | | qualityBG.SetSprite("herodz" + heroConfig.Quality); |
| | | // int skinID = 0; |
| | |
| | | } |
| | | if (cellContainer == null) |
| | | { |
| | | cellContainer = await UIUtility.CreateWidget("HeroShowBaseCell", "Container_HeroShow"); |
| | | var inst = await UIUtility.CreateWidget("HeroShowBaseCell", "Container_HeroShow"); |
| | | |
| | | if (this == null) |
| | | { |
| | | if (cellContainer != null) |
| | | { |
| | | DestroyImmediate(cellContainer); |
| | | return; |
| | | } |
| | | if (inst != null) DestroyImmediate(inst); |
| | | return; |
| | | } |
| | | |
| | | if (cellContainer != null) |
| | | { |
| | | DestroyImmediate(inst); |
| | | return; |
| | | } |
| | | cellContainer = inst; |
| | | |
| | | if (cellContainer != null) |
| | | { |
| | | cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | cellContainer.transform.SetAsFirstSibling(); |
| | | } |