示例#1
0
文件: Die.cs 项目: ManicDesigns/Dice4
    public Coroutine SetLEDsToColor(Color color)
    {
        var     msg     = new DieMessageSetAllLEDsToColor();
        Color32 color32 = color;

        msg.color = (uint)((color32.r << 16) + (color32.g << 8) + color32.b);
        return(PerformBluetoothOperation(() => PostMessage(msg)));
    }
示例#2
0
文件: Die.cs 项目: ManicDesigns/Dice4
    public Coroutine SetLEDsToRandomColor()
    {
        var  msg = new DieMessageSetAllLEDsToColor();
        uint r   = (byte)Random.Range(0, 256);
        uint g   = (byte)Random.Range(0, 256);
        uint b   = (byte)Random.Range(0, 256);

        msg.color = (r << 16) + (g << 8) + b;
        return(PerformBluetoothOperation(() => PostMessage(msg)));
    }