| | |
| | | public async UniTask Init(int skillID, UnityAction onclick = null, bool showType = false) |
| | | { |
| | | await LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | if (this == null) return; |
| | | var config = SkillConfig.Get(skillID); |
| | | if (config == null) |
| | | { |
| | |
| | | } |
| | | if (cellContainer == null) |
| | | { |
| | | cellContainer = await UIUtility.CreateWidget("SkillWordCell", "Container_SkillCell"); |
| | | var inst = await UIUtility.CreateWidget("SkillWordCell", "Container_SkillCell"); |
| | | |
| | | if (this == null) |
| | | { |
| | | if (null != cellContainer) |
| | | { |
| | | DestroyImmediate(cellContainer); |
| | | } |
| | | if (null != inst) 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(); |
| | | } |