Tanoda
DropArea.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class DropArea : MonoBehaviour
6{
7 public List<DropCondition> DropConditions = new List<DropCondition>();
8 public event Action<MouseDragBehaviour> OnDropHandler;
9
10 public bool Accepts(MouseDragBehaviour draggable)
11 {
12 return DropConditions.TrueForAll(cond => cond.Check(draggable));
13 }
14
15 public void Drop(MouseDragBehaviour draggable)
16 {
17 if (draggable)
18 {
19 OnDropHandler?.Invoke(draggable);
20 }
21
22 }
23}
Action< MouseDragBehaviour > OnDropHandler
Definition: DropArea.cs:8
List< DropCondition > DropConditions
Definition: DropArea.cs:7
void Drop(MouseDragBehaviour draggable)
Definition: DropArea.cs:15
bool Accepts(MouseDragBehaviour draggable)
Definition: DropArea.cs:10