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
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
相关文章推荐
- 解决github push错误The requested URL returned error: 403 Forbidden while accessing
- 随意细解:UI -- 多线程编程
- [LeetCode] Distinct Subsequences 解题思路
- iOS开发之UICollectionView
- UITextView的Placeholder占位文字
- 创建UICollectionView时出错UICollectionView must be initialized with a non-nil layout parameter
- UIImage 与 base64 互转
- 创建UICollectionView时出错UICollectionView must be initialized with a non-nil layout parameter
- 爬爬爬之路:UI(十九) 多线程
- UIControl
- break 与continue 语句
- DDuilib入门-XML布局【二】
- 黑马程序员之JAVA CUI
- Duilib源码分析(五)UI布局—Layout与各子控件
- 访谈将源代码的函数 strcpy/memcpy/atoi/kmp/quicksort
- [Leetcode]Range Sum Query
- UITableView详解
- Imageloader<6>-mUIHandler的初始化
- Android: 在UI线程更新UI的几种方式
- UI UIControl