Tanoda
OnDraggedEventTexture.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using GILES.Interface;
4using UnityEngine;
5using UnityEngine.UI;
6
7[RequireComponent(typeof(RawImage))]
8public class OnDraggedEventTexture : MonoBehaviour
9{
10 void OnSimpleDragAndDropEvent(DragAndDropCell.DropEventDescriptor desc)
11 {
12 if (desc.item.GetComponentInChildren<RawImage>())
13 {
14 GetComponent<RawImage>().texture = desc.item.GetComponentInChildren<RawImage>().texture;
15 var asset = desc.item.GetComponentInChildren<pb_PrefabBrowserItemButton>().asset;
16 GetComponentInParent<pb_RawImageInspector>().TextureChanged(asset.name);
17 //desc.item.GetComponentInChildren<pb_PrefabBrowserItemButton>().asset
18 }
19 desc.permission = false;
20 }
21}
Every item's cell must contain this script