Exemplo n.º 1
0
 public override void OnEndDrag(PointerEventData eventData)
 {
     base.OnEndDrag(eventData);
     //slotIndex已经在drop逻辑内重新赋值
     transform.SetParent(KnapsackManager.GetInstance().slotBagList[slotIndex].transform);
     transform.position = transform.parent.position;
     GetComponent <CanvasGroup>().blocksRaycasts = true;
 }
Exemplo n.º 2
0
 void IPointerExitHandler.OnPointerExit(PointerEventData eventData)
 {
     if (this.transform.childCount > 0)
     {
         isEnter = false;
         KnapsackManager.GetInstance().HideToolTilePanel();
     }
 }
Exemplo n.º 3
0
 public override void OnBeginDrag(PointerEventData eventData)
 {
     base.OnBeginDrag(eventData);
     if (itemData != null)
     {
         transform.SetParent(transform.parent.parent);
         transform.position = eventData.position;
         GetComponent <CanvasGroup>().blocksRaycasts = false;
         //如果描述界面显示 就把他关闭
         KnapsackManager.GetInstance().HideToolTilePanel();
         KnapsackManager.GetInstance().slotBagList[slotIndex].GetComponent <BagSlot>().isEnter = false;
     }
 }
Exemplo n.º 4
0
 private void Update()
 {
     if (isEnter)
     {
         //鼠标悬停0.5f秒钟显示描述界面
         temp -= Time.deltaTime;
         if (temp <= 0)
         {
             string text = inv.GetDescribe(inv.itemBagList[slotID]);
             KnapsackManager.GetInstance().ShowToolTilePanel(text);
             temp = 0.5f;
         }
     }
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     inv = KnapsackManager.GetInstance();
 }