| | |
| | | private GameObject instanceGO; |
| | | |
| | | private Action onComplete; |
| | | public void Create(int _skinID, float scale = 1f, Action _onComplete = null, string motionName = "idle", bool isLh = false) |
| | | public void Create(int _skinID, float scale = 0.8f, Action _onComplete = null, string motionName = "idle", bool isLh = false) |
| | | { |
| | | if (skinID == _skinID) |
| | | { |
| | |
| | | { |
| | | skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinConfig.SpineRes); |
| | | } |
| | | if (skeletonGraphic.skeletonDataAsset == null) |
| | | { |
| | | |
| | | transform.SetActive(false); |
| | | if (pool != null) |
| | | pool.Release(instanceGO); |
| | | skeletonGraphic = null; |
| | | Destroy(instanceGO); |
| | | Debug.LogError("未配置spine"); |
| | | return; |
| | | } |
| | | skeletonGraphic.Initialize(true); |
| | | this.transform.localScale = Vector3.one * scale; |
| | | spineAnimationState = skeletonGraphic.AnimationState; |