/// <summary> /// Called when the referenced node (or a node in its subtree) changed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="eventArgs"> /// The <see cref="SceneChangedEventArgs"/> instance containing the event data. /// </param> private void OnNodeSceneChanged(object sender, SceneChangedEventArgs eventArgs) { if (_ignoreChanges) { return; } switch (eventArgs.Changes) { case SceneChanges.NodeAdded: SetProxy(eventArgs.SceneNode, this); UpdateBoundingShape(); break; case SceneChanges.NodeRemoved: SetProxy(eventArgs.SceneNode, null); UpdateBoundingShape(); break; case SceneChanges.PoseChanged: case SceneChanges.ShapeChanged: UpdateBoundingShape(); break; } }
private void SceneChanged(object sender, SceneChangedEventArgs e) { CurrentScene = e.Scene; LastSignal = e.Trigger; CurrentData = SceneTranslator.GetData(CurrentScene, Universe); _channelSink.SetChannels(CurrentData); }
private async void SelectedSceneChanged(object sender, SceneChangedEventArgs args) { if (Window3DVMContext.Current.Start3DVisible) { return; } try { await Change3DScene(args.NewScene); } catch (Exception ex) { string error = string.Format("Ошибка при попытки сменить сцену в 3D. {0}", ex.Message); Debug.WriteLine(error); Logger.AddMessage(MessageType.Error, error); } }
private void SceneChanged_RevertTransition(object sender, SceneChangedEventArgs e) { if (!String.IsNullOrEmpty(revertTransition)) { Task.Run(async() => { await Task.Delay(1000); lock (objRevertTransition) { if (!String.IsNullOrEmpty(revertTransition)) { Logger.Instance.LogMessage(TracingLevel.INFO, $"Reverting back to original transition"); OBSManager.Instance.SetTransition(revertTransition); } revertTransition = String.Empty; } }); } }
public void Signal(ISignal signal) { var scene = new Scene(); foreach (var device in Universe.Devices.Keys) { if (device is RgbLight rgbLight) { var rgbState = new RgbLightState(rgbLight) { Color = Color.Red }; scene.DeviceStates.Add(rgbState); } } var e = new SceneChangedEventArgs(signal, scene); SceneChanged?.Invoke(this, e); }
private async void SelectedSceneChanged(object sender, SceneChangedEventArgs args) { if (Window3DVMContext.Current.Start3DVisible) return; try { await Change3DScene(args.NewScene); } catch (Exception ex) { string error = string.Format("Ошибка при попытки сменить сцену в 3D. {0}", ex.Message); Debug.WriteLine(error); Logger.AddMessage(MessageType.Error, error); } }
private void OnDirectionalLightNodeChanged(object sender, SceneChangedEventArgs eventArgs) { _godRayFilter.Enabled = _directionalLightNode.IsEnabled; _godRayFilter.LightDirection = _directionalLightNode.PoseWorld.ToWorldDirection(Vector3F.Forward); }