File was renamed from Assets/Scripts/Guide/ImageSkill.cs |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.EventSystems; |
| | | using UnityEngine.UI; |
| | | using KTGMGemClient; |
| | | |
| | | public class ImageSkill : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler |
| | | public class ImageWood2 : GuideImageBase, IDragHandler, IBeginDragHandler, IEndDragHandler |
| | | { |
| | | bool isDraging; |
| | | public bool IsDraging |
| | | { |
| | | get |
| | | { |
| | | return isDraging; |
| | | } |
| | | } |
| | | public void OnBeginDrag(PointerEventData eventData) |
| | | { |
| | | isDraging = true; |
| | | tmpImage.raycastTarget = false; |
| | | GuideCtrl.Ins.BeginDrag11_1(); |
| | | GuideCtrl.Ins.BeginDrag(); |
| | | } |
| | | |
| | | Vector3 dragPos; |
| | |
| | | public void OnEndDrag(PointerEventData eventData) |
| | | { |
| | | isDraging = false; |
| | | if (skillRim != null) |
| | | if (imageWood1 != null) |
| | | { |
| | | //释放技能 |
| | | Debug.Log("释放技能"); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.SkillRelease); |
| | | |
| | | //合成宝石 |
| | | Debug.Log("合成宝石"); |
| | | imageWood1.GetComponent<ImageWood>().Add(); |
| | | gameObject.SetActive(false); |
| | | } |
| | | else |
| | |
| | | tmpImage.raycastTarget = true; |
| | | |
| | | //返回原位,提示开始推拽 |
| | | GuideCtrl.Ins.EndDrag11_1(); |
| | | GuideCtrl.Ins.EndDrag(); |
| | | } |
| | | |
| | | } |
| | | |
| | | GameObject skillRim; |
| | | GameObject imageWood1; |
| | | Image tmpImage; |
| | | |
| | | Vector2 pos; |
| | | |
| | | RectTransform rectTransform; |
| | | //Vector3 startP; |
| | | public Vector2 GetStartP |
| | | { |
| | | get |
| | |
| | | return pos; |
| | | } |
| | | } |
| | | RectTransform rectTransform; |
| | | |
| | | // Start is called before the first frame update |
| | | private void Awake() |
| | | { |
| | | //imageFire1 = transform.parent.Find("Image_Fire1").GetComponent<ImageFire1>(); |
| | | tmpImage = GetComponent<Image>(); |
| | | rectTransform = GetComponent<RectTransform>(); |
| | | pos = rectTransform.anchoredPosition; |
| | | } |
| | | |
| | | public void SetTarget(GameObject target) |
| | | public override void SetTarget(GameObject target) |
| | | { |
| | | skillRim = target; |
| | | imageWood1 = target; |
| | | } |
| | | |
| | | } |
| | | |