Skip to content

DropZone

Namespace: SideXP.Core.EditorOnly

public static class DropZone

Utility for drawing "drop zones" used to handle drag and drop for given types of objects.

Methods

Draw(Rect, Type[], DropDelegate, CanDropDelegate)

public static void Draw(Rect position, Type[] allowedTypes, DropDelegate onDrop, CanDropDelegate canDrop = null)

Draws a "drop zone" on the GUI, in which objects can be drag and dropped.

Parameters

  • position: The position and size of the drop zone on screen.
  • allowedTypes: The allowed object types for this drop zone.
  • onDrop: Called when items are dropped in this drop zone.
  • canDrop: Additional function to check if items can be dropped. Note that this is called after checking if the items have the appropriate types.

Draw<T>(Rect, DropDelegate<T>, CanDropDelegate<T>)

public static void Draw<T>(Rect position, DropDelegate<T> onDrop, CanDropDelegate<T> canDrop = null)

Type parameters

  • T: The type of objects allowed to be dropped in this drop zone.

Draw<T1, T2>(Rect, DropDelegate, CanDropDelegate)

public static void Draw<T1, T2>(Rect position, DropDelegate onDrop, CanDropDelegate canDrop = null)

Type parameters

  • T1: The first type of objects allowed to be dropped in this drop zone.
  • T2: The second type of objects allowed to be dropped in this drop zone.

Draw<T1, T2, T3>(Rect, DropDelegate, CanDropDelegate)

public static void Draw<T1, T2, T3>(Rect position, DropDelegate onDrop, CanDropDelegate canDrop = null)

Type parameters

  • T1: The first type of objects allowed to be dropped in this drop zone.
  • T2: The second type of objects allowed to be dropped in this drop zone.
  • T3: The third type of objects allowed to be dropped in this drop zone.

Draw<T1, T2, T3, T4>(Rect, DropDelegate, CanDropDelegate)

public static void Draw<T1, T2, T3, T4>(Rect position, DropDelegate onDrop, CanDropDelegate canDrop = null)

Draws a "drop zone" on the GUI, in which objects can be drag and dropped.

Type parameters

  • T1: The first type of objects allowed to be dropped in this drop zone.
  • T2: The second type of objects allowed to be dropped in this drop zone.
  • T3: The third type of objects allowed to be dropped in this drop zone.
  • T4: The fourth type of objects allowed to be dropped in this drop zone.

Parameters

  • position: The position and size of the drop zone on screen.
  • onDrop: Called when items are dropped in this drop zone.
  • canDrop: Additional function to check if items can be dropped. Note that this is called after checking if the items have the appropriate types.