Dice Master - v1.1.0

Dice Master is a complete package for all your dice needs.
The system handles different dice at runtime and allows you to create custom dice from a few textures.
The system is designed to be easy to use, so you can start rolling as soon as possible.
Common dice examples are also already set-up for you and ready to be used.

Quick Start

This section will showcase the example scenes included with the tool.

Common concepts

Dice Master works through a set of components that can be attached to GameObjects. Each component has a specific function, as follows:

Note: the green and pink lines that appear when you attach a Spinner or a Thrower will help you visualize the dice trajectory when spun/thrown.

Example scene: ExampleDiceAll

This scene showcases all the dice that are already included with the tool.
These dice work as examples of what can be done with the tool, although they are ready to be used for your games.

Example scene: ExampleDiceMassSpawn

This scene showcases mass spawning of dice.
The scene is setup with a Spawner that will create a set of D6 when the user presses the 'S' key.
The Spawner also has a Thrower and Spinner attached, which will make the newly created dice jump and rool at startup.

Example scene: ExampleDiceResultRegister

This scene showcases dice result registering, i.e. checking the results of dice.
The scene is setup with 3 D6 which are spinned as the scene start (notice the Spinner attached to the 3 dice GameObjects).
The TestDiceRegister script registers to the dice events, so that when the dice is resting the register will get all the results and add them.

Example scene: ExampleDiceRoller

This scene showcases dice rolling.
Notice that the provided D20 has a Thrower and a Spinner.
These two components are triggered through the Roller script.
The ResultUI canvas element registers to the D20 dice results and shows them to screen each time it is rolled.

Example scene: ExampleDiceSpawnSelector

This scene showcases a mix of dice spawning and result registering.
The SpawnSelector script will use a Spawner to spawn different dice as selected from the in-game UI.
The TestSpawnRegister will attach to the Spawner and wait for a dice to be spawned, so that it can collect the result.

Example scene: ExampleDiceSpawnFormat

This scene showcases spawning dice using a dice string, in the format of "5D6".
The SpawnFormat script will use a Spawner to spawn different dice as selected from the in-game UI.

Example scene: ExampleDiceDynamicFaces

This scene showcases a dice with dynamic faces. These faces are textured quads, instead of being drawn on the texture, which allows runtime code to edit and animate the faces.
The TestCustomFaces will attach to the Dice and animate the shown face when it is read.

Example scene: ExampleDiceCustomFaces

This scene showcases a dice with custom faces. These faces could be any gameobject and can be accessed from the Dice itself.
The TestCustomFaces will attach to the Dice and animate the shown face when it is read.

Basic Usage

This section will teach you how to setup Dice Master for common uses.

How to: Roll an existing dice

How to: Detect the result of a dice throw

Note: you can check the TestDiceRoller example scene to see the result.

How to: Spawn a dice

Note: you can combine spawning and result checking! See the TestSpawnRegister script for an example of use.

Creating new dice

If the default dice are not enough for your needs, you can use Dice Master to create new dice prefabs.

You may need the following assets (although common assets are already provided for you to use!):

Once you have everything, proceed as follows: Note that pips/faces have various parameters you can edit to change their appearance and arrangement on the faces:

Accessing the API

All APIs are located in the DiceMaster namespace.

System Configuration

You can configure the system by editing values in the DiceConfig custom asset instance, which can be found in the DiceMaster/Resources folder. Note: Due to a bug with the Unity Asset Store, paths are not exposed in the inspector and must thus be edited by editing the DiceConfig.cs file directly. Here is a rundown of what you can edit:



Dice Creation


For any enquiry, for support, and for feature suggestion, contact me