The Deferred Runtime Operation Library (Dropl) provides users with a variety of tools and utilities to defer any operations such that they can be executed over time or at a later point in time.
Via GitHub This package can be installed in the Unity Package Manager using the following git URL.
Alternatively, you can download the latest release from the releases page and manually import the package into your project.
The Dropl library provides game developers with a variety of tools and utilities to defer any set of operations such that it can be executed over time or at a later point in time from the time of the request. This is useful for a variety of use cases such as UI animations, game logic, and more.
There are two main components to the library, the
Operation, and the
Executer. The abstract
Operation class is used to define how a set of instructions need to be executed over time and the
Executer is used to manage the execution of the defined operations.
For example, let’s take this simple operation that moves a
Transform from its current position to a target position over some time.
// move the current transform to the position (0, 5, 0) over 5 seconds using a linear interpolation // additionally, dropl provides a variety of other interpolation methods to work with var moveOperation = new MoveOperation(transform, expectedPosition: new vector3(0, 5, 0), duration: 5f, easing: Interpolations.LINEAR);
The next step would be to add this operation to an
Executer. The users can either create custom
Executers or use the default
Executer provided by the library.
// add the defined operation to the default executer Executer.DefaultExecuter.Add(moveOperation); // or alternatively, use the helper method AddToDefaultExecuter moveOperation.AddToDefaultExecuter();
The library additionally provides a variety of core operations that can be used to create more complex operations.
- Sequence - Executes a set of operations in a sequence
- LambdaOperation - Executes any instructions provided by the user without creating a new class
- PropertyOperation - Execute any property changes over a period of time
Visit other pages in this documentation to learn more about the library and its features.