NGUI(三)背包系统页面

来源:互联网 发布:淘宝网副总裁张勤 编辑:程序博客网 时间:2024/05/16 14:27

NGUI(三)背包系统页面



MyDragDropItem:
using UnityEngine;using System.Collections;public class MyDragDropItem : UIDragDropItem {// Use this for initialization    protected override void OnDragDropRelease(GameObject surface)    {        base.OnDragDropRelease(surface);        if (surface.tag=="cell")        {            this.transform.parent = surface.transform;            this.transform.localPosition = Vector3.zero;        }        else if(surface.tag=="MyDragDropItems")        {            Transform parent = surface.transform.parent;            surface.transform.parent = this.transform.parent;            surface.transform.localPosition = Vector3.zero;            this.transform.parent = parent;            this.transform.localPosition = Vector3.zero;        }    }}

Knapsack:
using UnityEngine;using System.Collections;public class Knapsack : MonoBehaviour {    public GameObject[] cells;// Use this for initializationvoid Start () {}// Update is called once per framevoid Update () {}}


0 0
原创粉丝点击