示例#1
0
    IEnumerator SendDelayedUpdateEvent(float delayTime, HueEventArgs eventData)
    {
        yield return new WaitForSeconds(delayTime);

          if (OnLightChanged != null)
         OnLightChanged(this, eventData);
    }
示例#2
0
    void SendEvents(Light l, Color prevColor, float prevFade)
    {
        //notify anyone who cares
          if ((OnLightCommandSent != null) || (OnLightChanged != null))
          {
         float eventFade = l.fade;
         if (!l.on)
            eventFade = 0.0f;
         HueEventArgs eventData = new HueEventArgs(l.id, l.color, eventFade, l.transitionTime, prevColor, prevFade);

         if (OnLightCommandSent != null)
            OnLightCommandSent(this, eventData);

         //run co-routine to send out event for game after latency elapses (so visuals in-game don't trigger early)
         if (OnLightChanged != null)
            StartCoroutine(SendDelayedUpdateEvent(GetCurLatency(), eventData));
          }
    }
示例#3
0
 private void _hue_StatusUpdate(object sender, HueEventArgs e)
 {
     Status = e.Status;
 }