void Awake() { Instance = this; }
void OnHueLightChanged(object sender, HueMessenger.HueEventArgs e) { if (OnLightChanged != null) { GroupID gID = GroupID.RiftGroup1; LightID lID = LightID.Light1; if (FindLight(e.LightID, LightTypes.Hue, ref gID, ref lID)) { LightData newData = new LightData(e.LightColor, e.LightFade); //simulate fades if (e.TransitionTime > 0.0) { LightData fromData = new LightData(e.PrevColor, e.PrevFade); BlendHueData newBlendData = new BlendHueData(gID, lID, fromData, newData, e.TransitionTime); foreach (BlendHueData h in _eventBlends) { if ((h.GetGroupID() == gID) && (h.GetLightID() == lID)) { _eventBlends.Remove(h); break; } } _eventBlends.Add(newBlendData); } else { SendHueEvent(gID, lID, newData); } } } }