/// <summary> /// Sends fade LED animation request /// </summary> /// <param name='dicePlus'> /// the die to which to send command/request /// </param> /// <param name='ledMask'> /// which LEDs to run animation on /// </param> /// <param name='priority'> /// animation with lower value overrides other, values: 0 - 255 /// </param> /// <param name='color'> /// color to be faded /// </param> /// <param name='fadeInOutTime'> /// time in ms LED is fading in/out, values: 0 - 65535 /// </param> /// <param name='pauseTime'> /// time in ms LED stays at full bright before fading out, values: 0 - 65535 /// </param> public void runFadeAnimation(DicePlus dicePlus, LedFace ledMask, int priority, Color color, int fadeInOutTime, int pauseTime) { #if UNITY_EDITOR #elif UNITY_IPHONE ios_runFadeAnimation(dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), fadeInOutTime, pauseTime); #elif UNITY_ANDROID if (dmo != null) { dmo.Call("runFadeAnimation", new object [] {dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), fadeInOutTime, pauseTime}); } #endif }
/// <summary> /// Sends standard LED animation request /// </summary> /// <param name='dicePlus'> /// the die to which to send command/request /// </param> /// <param name='ledMask'> /// which LEDs to run animation on /// </param> /// <param name='priority'> /// animation with lower value overrides other, values: 0 - 255 /// </param> /// <param name='animation'> /// standard animation type /// </param> public void runStandardAnimation(DicePlus dicePlus, LedFace ledMask, int priority, DicePlusConnector.AnimationType animation) { #if UNITY_EDITOR #elif UNITY_IPHONE ios_runStandardAnimation(dicePlus.address, (int)ledMask, priority, (int)animation); #elif UNITY_ANDROID if (dmo != null) { dmo.Call("runStandardAnimation", new object [] {dicePlus.address, (int)ledMask, priority, (int)animation}); } #endif }
/// <summary> /// Sends blink LED animation request /// </summary> /// <param name='dicePlus'> /// the die to which to send command/request /// </param> /// <param name='ledMask'> /// which LEDs to run animation on /// </param> /// <param name='priority'> /// animation with lower value overrides other, values: 0 - 255 /// </param> /// <param name='color'> /// color to be blinked /// </param> /// <param name='ledOnPeriod'> /// time in ms LED is ON, values: 0 - 65535 /// </param> /// <param name='ledCyclePeriod'> /// time in ms one blink cycle lasts, values: 0 - 65535 /// </param> /// <param name='blinkNumber'> /// number of blinks, values: 0 - 255 /// </param> public void runBlinkAnimation(DicePlus dicePlus, LedFace ledMask, int priority, Color color, int ledOnPeriod, int ledCyclePeriod, int blinkNumber) { #if UNITY_EDITOR #elif UNITY_IPHONE ios_runBlinkAnimation(dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), ledOnPeriod, ledCyclePeriod, blinkNumber); #elif UNITY_ANDROID if (dmo != null) { dmo.Call("runBlinkAnimation", new object [] {dicePlus.address, (int)ledMask, priority, (int)(color.r*255), (int)(color.g*255), (int)(color.b*255), ledOnPeriod, ledCyclePeriod, blinkNumber}); } #endif }