| | |
| | | |
| | | using Spine.Unity; |
| | | using UnityEngine; |
| | | |
| | | using UnityEngine.EventSystems; |
| | | public class UIHeroController : MonoBehaviour |
| | | { |
| | | public static UIHeroController Create(HeroSkinConfig skinCfg, Transform _parent = null) |
| | |
| | | |
| | | private Spine.TrackEntry currentTrackEntry; |
| | | |
| | | private UIEventTrigger uiEventTrigger; |
| | | |
| | | void Awake() |
| | | { |
| | | skeletonGraphic = gameObject.GetComponentInChildren<SkeletonGraphic>(true); |
| | | uiEventTrigger = UIEventTrigger.Get(skeletonGraphic.gameObject); |
| | | |
| | | uiEventTrigger.OnClick = OnClick; |
| | | |
| | | spineAnimationState = skeletonGraphic.AnimationState; |
| | | PlayAnimation(MotionName.idle, true); |
| | | |
| | |
| | | PlayAnimation(MotionName.idle, true); |
| | | } |
| | | |
| | | protected void OnClick() |
| | | protected void OnClick(GameObject go,PointerEventData eventData) |
| | | { |
| | | PlayAnimation(MotionName.attack); |
| | | } |