Pixels Plugin for Unity
Enable communications with Pixels dice using Bluetooth Low Energy.
|
A collection of C# classes for the Unity game engine that enables communications with Pixels dice. The Pixel class represents a die peripheral and the DiceBag static class implements methods for scanning for and connecting to Pixels. More...
Namespaces | |
namespace | Animations |
Set of types for manipulating Pixel LEDs animations data. | |
namespace | Profiles |
Set of types for manipulating Pixel animation profiles data. | |
Classes | |
class | ColorUIntUtils |
Helper static class that implements various color operations with the color information being stored as an unsigned 32 bits value. In related methods, the intensity is a byte value between 0 (black) and 255 (white). More... | |
class | DiceBag |
Static class that scan for and connect to Pixel dice. Scan and connection requests are counted, meaning that the same number of respectively scan cancellation and disconnection requests must be made for them to effectively happen. More... | |
class | DiceUtils |
Helper static class that implements various gamma operations on colors. More... | |
class | GammaUtils |
Helper static class that implements various gamma operations on colors. More... | |
class | Pixel |
Represents a Pixel die. More... | |
class | PixelBleUuids |
Pixel dice Bluetooth Low Energy UUIDs. More... | |
Enumerations | |
enum | PixelDieType : byte { Unknown = 0 , D4 , D6 , D8 , D10 , D00 , D12 , D20 , D6Pipped , D6Fudge } |
The different types of dice. | |
enum | PixelColorway : byte { Unknown = 0 , OnyxBlack , HematiteGrey , MidnightGalaxy , AuroraSky , Clear , WhiteAurora , Custom = 0xFF } |
Available Pixels dice colorways. | |
enum | PixelRollState : byte { Unknown = 0 , Rolled , Handling , Rolling , Crooked , OnFace } |
Pixels dice roll states. | |
enum | PixelBatteryState : byte { Ok = 0 , Low , Charging , Done , BadCharging , Error } |
Pixel battery states. More... | |
enum | PixelConnectionState { Invalid = -1 , Available , Connecting , Identifying , Ready , Disconnecting } |
Pixel connection states. More... | |
enum | PixelError { None = 0 , ConnectionError , Disconnected } |
Identify an error encountered while communicating with a PixeL. More... | |
Functions | |
delegate void | ConnectionResultCallback (Pixel pixel, bool ready, string error) |
Delegate for Pixel connection request result. | |
delegate void | OperationResultCallback (bool success, string error) |
Delegate for Pixel operations result. | |
delegate void | DataOperationResultCallback (byte[] data, string error) |
Delegate for Pixel operations returning some data. | |
delegate void | OperationProgressCallback (Pixel pixel, float progress) |
Delegate for Pixel operations progress reporting. | |
delegate void | ConnectionStateChangedEventHandler (Pixel pixel, PixelConnectionState state) |
Delegate for Pixel connection state events. | |
delegate void | ErrorRaisedEventHandler (Pixel pixel, PixelError error) |
Delegate for Pixel communication error events. | |
delegate void | AppearanceChangedEventHandler (Pixel pixel, int ledCount, PixelDieType dieType, PixelColorway colorway) |
Delegate for Pixel appearance setting changes. | |
delegate void | RollStateChangedEventHandler (Pixel pixel, PixelRollState rollState, int face, int faceIndex) |
Delegate for Pixel roll events. | |
delegate void | BatteryLevelChangedEventHandler (Pixel pixel, int batteryLevel, bool isCharging) |
Delegate for Pixel battery level changes. | |
delegate void | RssiChangedEventHandler (Pixel pixel, int rssi) |
Delegate for Pixel RSSI changes. | |
delegate void | TemperatureChangedEventHandler (Pixel pixel, float mcuTemperature, float batteryTemperature) |
Delegate for Pixel temperature changes. | |
delegate void | TelemetryEventHandler (Pixel pixel, AccelerationFrame frame) |
Delegate for Pixel telemetry events. | |
delegate void | NotifyUserCallback (Pixel pixel, string text, bool canCancel, System.Action< bool > userActionCallback) |
Delegate for Pixel requests to notify user of some message, with the option to cancel the operation. | |
delegate void | PlayAudioClipCallback (Pixel pixel, uint clipId) |
Delegate for Pixel requests to play an audio clip. | |
A collection of C# classes for the Unity game engine that enables communications with Pixels dice. The Pixel class represents a die peripheral and the DiceBag static class implements methods for scanning for and connecting to Pixels.
enum Systemic.Unity.Pixels.PixelBatteryState : byte |
Pixel battery states.
Pixel connection states.
delegate void Systemic.Unity.Pixels.AppearanceChangedEventHandler | ( | Pixel | pixel, |
int | ledCount, | ||
PixelDieType | dieType, | ||
PixelColorway | colorway | ||
) |
Delegate for Pixel appearance setting changes.
pixel | The source of the event. |
ledCount | Number of LEDs on the die. |
dieType | Type of the die. |
colorway | The coloring of the die. |
delegate void Systemic.Unity.Pixels.BatteryLevelChangedEventHandler | ( | Pixel | pixel, |
int | batteryLevel, | ||
bool | isCharging | ||
) |
Delegate for Pixel battery level changes.
pixel | The source of the event. |
batteryLevel | The latest battery level reported by the die, in percent. |
isCharging | Whether or not the battery is reported as charging. |
delegate void Systemic.Unity.Pixels.ConnectionResultCallback | ( | Pixel | pixel, |
bool | ready, | ||
string | error | ||
) |
Delegate for Pixel connection request result.
pixel | The source of the event. |
ready | Whether the Pixel is ready for communications. |
error | The error if it failed to connect. |
delegate void Systemic.Unity.Pixels.ConnectionStateChangedEventHandler | ( | Pixel | pixel, |
PixelConnectionState | state | ||
) |
Delegate for Pixel connection state events.
pixel | The source of the event. |
state | The current connection sate. |
delegate void Systemic.Unity.Pixels.DataOperationResultCallback | ( | byte[] | data, |
string | error | ||
) |
Delegate for Pixel operations returning some data.
data | The resulting data. |
error | The error if the operation failed. |
delegate void Systemic.Unity.Pixels.ErrorRaisedEventHandler | ( | Pixel | pixel, |
PixelError | error | ||
) |
Delegate for Pixel communication error events.
pixel | The source of the event. |
error | The type of error. |
delegate void Systemic.Unity.Pixels.NotifyUserCallback | ( | Pixel | pixel, |
string | text, | ||
bool | canCancel, | ||
System.Action< bool > | userActionCallback | ||
) |
Delegate for Pixel requests to notify user of some message, with the option to cancel the operation.
pixel | The source of the event. |
text | The text to display to the user. |
canCancel | Whether the user may cancel the operation. |
userActionCallback | The callback to run once the user has acknowledged the message. False may be passed to cancel the operation when applicable. |
delegate void Systemic.Unity.Pixels.OperationProgressCallback | ( | Pixel | pixel, |
float | progress | ||
) |
Delegate for Pixel operations progress reporting.
pixel | The source of the event. |
progress | The progress, between 0 and 1 included. |
delegate void Systemic.Unity.Pixels.OperationResultCallback | ( | bool | success, |
string | error | ||
) |
Delegate for Pixel operations result.
success | Whether the operation succeeded. |
error | The error if the operation failed. |
delegate void Systemic.Unity.Pixels.PlayAudioClipCallback | ( | Pixel | pixel, |
uint | clipId | ||
) |
Delegate for Pixel requests to play an audio clip.
pixel | The source of the event. |
clipId | The audio clip id to play. |
delegate void Systemic.Unity.Pixels.RollStateChangedEventHandler | ( | Pixel | pixel, |
PixelRollState | rollState, | ||
int | face, | ||
int | faceIndex | ||
) |
Delegate for Pixel roll events.
pixel | The source of the event. |
rollState | The roll state. |
face | The face that is up (fudge die returns +1, 0 and -1). |
faceIndex | The 0-based index of the die face that is up. |
delegate void Systemic.Unity.Pixels.RssiChangedEventHandler | ( | Pixel | pixel, |
int | rssi | ||
) |
Delegate for Pixel RSSI changes.
pixel | The source of the event. |
rssi | The latest RSSI in dBm reported by the die. |
delegate void Systemic.Unity.Pixels.TelemetryEventHandler | ( | Pixel | pixel, |
AccelerationFrame | frame | ||
) |
Delegate for Pixel telemetry events.
pixel | The source of the event. |
frame | The latest acceleration data reported by the die. |
delegate void Systemic.Unity.Pixels.TemperatureChangedEventHandler | ( | Pixel | pixel, |
float | mcuTemperature, | ||
float | batteryTemperature | ||
) |
Delegate for Pixel temperature changes.
pixel | The source of the event. |
temperature | The latest temperature for the micro-controller and the battery in Celsius degrees reported by the die. |