您的位置:首页 > 产品设计 > UI/UE

NGUI 背包系统的拖拽

2015-12-14 22:37 519 查看
1.使用拖拽脚本进行拖拽

2.通过重写脚本

using UnityEngine;

using System.Collections;

public class MyDraDropitem : UIDragDropItem {

    protected override void OnDragDropRelease(GameObject surface)

    {

        base.OnDragDropRelease(surface);

        if (surface .transform.childCount>0)

        {

        }

        else

        {

        }

        this.transform.parent = surface.transform;

        this.transform.localPosition = Vector3.zero;

    }

}

3.通过节点

using UnityEngine;

using System.Collections;

public class Knapsack : MonoBehaviour {

public GameObject[] cells;

}

数组来确定cell的 位置
http://www.taikr.com/course/34/learn#lesson/1228
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: