Tanoda
OnDraggedEventHierarchy.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using GILES;
4using GILES.Interface;
5using UnityEngine;
6using UnityEngine.UI;
7
8public class OnDraggedEventHierarchy : MonoBehaviour
9{
10 void OnSimpleDragAndDropEvent(DragAndDropCell.DropEventDescriptor desc)
11 {
12 if (!desc.item.GetComponent<ReferenceSaver>())
13 {
14 desc.permission = false;
15 return;
16 }
17
18 desc.item.GetComponent<ReferenceSaver>().Reference.transform
19 .SetParent(desc.destinationCell.GetComponent<ReferenceSaver>()
20 ? desc.destinationCell.GetComponent<ReferenceSaver>().Reference.transform
21 : pb_Scene.instance.transform);
22 desc.permission = false;
23 pb_Hierarchy.instance.RebuildInspector();
24 }
25}
Every item's cell must contain this script