Tanoda
OnDraggedBelt.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using GILES.Interface;
4using UnityEngine;
5using UnityEngine.UI;
6
7public class OnDraggedBelt : MonoBehaviour
8{
9 public bool good = true;
10 public RawImage updateImage;
11 private GameObject cached;
12
13 void OnSimpleDragAndDropEvent(DragAndDropCell.DropEventDescriptor desc)
14 {
15 if (good)
16 {
17 ConveyorBeltManager.instance.SpawnGood = desc.item.GetComponent<pb_PrefabBrowserItemButton>().asset;
18 }
19 else
20 {
21 cached = desc.item.GetComponent<pb_PrefabBrowserItemButton>().asset;
22 }
23
24 if (updateImage && desc.item.GetComponentInChildren<RawImage>())
25 {
26 updateImage.texture = desc.item.GetComponentInChildren<RawImage>().texture;
27 }
28 desc.permission = false;
29 }
30
31 public void AddToBadSpawn()
32 {
33 if (cached)
34 {
35 ConveyorBeltManager.instance.AddBad(cached);
36 }
37 }
38
39 public void ClearList()
40 {
42 }
43}
Every item's cell must contain this script
void AddToBadSpawn()
RawImage updateImage
void ClearList()