增加事件监听
This commit is contained in:
parent
dc56dbb402
commit
5f791268ef
@ -2,6 +2,8 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using QFramework;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.EventSystems;
|
||||
using System;
|
||||
|
||||
namespace QFramework.Example
|
||||
{
|
||||
@ -52,6 +54,9 @@ namespace QFramework.Example
|
||||
}
|
||||
});
|
||||
|
||||
leftObj.OnDragEvent(leftOnDrag);
|
||||
|
||||
|
||||
var rightObj = GameObject.Instantiate(RightItem, RightContent);
|
||||
rightObj.transform.localPosition = item.pos;
|
||||
rightObj.rectTransform.sizeDelta = item.size;
|
||||
@ -75,6 +80,11 @@ namespace QFramework.Example
|
||||
|
||||
}
|
||||
|
||||
private void leftOnDrag(PointerEventData data)
|
||||
{
|
||||
data.selectedObject.transform.position = Input.mousePosition;
|
||||
}
|
||||
|
||||
protected override void OnShow()
|
||||
{
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user