| | |
| | | using UnityEngine.EventSystems; |
| | | public class UIHeroController : MonoBehaviour |
| | | { |
| | | public void Create(int _skinID, Action _onComplete = null) |
| | | public void Create(int _skinID, float scale = 1f, Action _onComplete = null) |
| | | { |
| | | skinID = _skinID; |
| | | onComplete = _onComplete; |
| | | GameObject battleGO = ResManager.Instance.LoadAsset<GameObject>("Hero/SpineRes", "Hero_001"); |
| | | GameObject battleGO = UILoader.LoadPrefab("UIHero"); |
| | | GameObject instanceGO = null; |
| | | if (!transform.gameObject.activeSelf) |
| | | { |
| | |
| | | var skinConfig = HeroSkinConfig.Get(skinID); |
| | | skeletonGraphic.skeletonDataAsset = ResManager.Instance.LoadAsset<SkeletonDataAsset>("Hero/SpineRes/", skinConfig.SpineRes + "_SkeletonData"); |
| | | skeletonGraphic.Initialize(true); |
| | | this.transform.localScale = Vector3.one * scale; |
| | | spineAnimationState = skeletonGraphic.AnimationState; |
| | | PlayAnimation(MotionName.idle, true); |
| | | |