using UnityEngine;
using System.Collections;
public class SkillItemIcon : UIDragDropItem {
//通过查看源码后 拖动后会调用克隆体的OnDradDropStart()方法 即为该方法
//只需要将该克隆体的父节点该成其他的就可以跑出scrollview里的子节点不能离开scrollview的限制
protected override void OnDragDropStart()
{
base.OnDragDropStart();
transform.parent = transform.root;
this.GetComponent<UISprite>().depth = 50;
}
using System.Collections;
public class SkillItemIcon : UIDragDropItem {
//通过查看源码后 拖动后会调用克隆体的OnDradDropStart()方法 即为该方法
//只需要将该克隆体的父节点该成其他的就可以跑出scrollview里的子节点不能离开scrollview的限制
protected override void OnDragDropStart()
{
base.OnDragDropStart();
transform.parent = transform.root;
this.GetComponent<UISprite>().depth = 50;
}
}
这样可以。