NGUI 背包系统的拖拽
2016-07-01 09:58
399 查看
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
相关文章推荐
- Your build settings specify a provisioning profile with the UUID, no provisioning profile was found
- UIButton的titleLabe setAttributeSting 首次不起作用
- require.js理解
- Git Commands Quick Notes
- servlet转发与重定向基本概念与区别
- iOS学习之TableView和UIScrollView的综合小应用
- iOS 自动布局 两个UILabel 迷思
- String StringBuilder StringBuffer 对比 总结得非常好
- 绘制像素到屏幕上
- BlockingQueue深入分析
- double frequency=cv::getTickFrequency(); const int64 start=cv::getTickCount();
- alias, bg, bind, break, builtin, caller, cd, command,
- alias, bg, bind, break, builtin, caller, cd, command,
- UITabBarController的使用
- UE4发布android应用
- B001-Atmega16-PORTA的定义-(ques=1)
- Android中BuildConfig类的那些事<一>
- Android漂亮的UI库集合
- 【GOF23设计模式】_策略模式_CRM中报价策略_GUI编程中布局管理器底层架构JAVA248
- 从UIViewController跳转到UITabBarController