private void OnUpdateLineRequested(LineModel line) { if (View.CanEmitEvent()) { UpdateLineSignal.Dispatch(line); } }
public override void OnRegister() { base.OnRegister(); View.PointerInfoSignal.AddListener(OnPointerInfoSignal); View.TogglePanelSignal.AddListener(OnTogglePanelSignal); View.LineSelectedSignal.AddListener(OnLineSelected); View.LineDeletedSignal.AddListener(OnLineDeletedRequested); View.LineUnSelectedSignal.AddListener(OnLineUnselected); View.LineCopiedSignal.AddListener(OnLineCopiedRequested); View.LineResetSignal.AddListener(OnLineResetRequested); FullCleanupSignal.AddListener(OnFullCleanupReceived); AddLineSignal.AddListener(OnLineAdded); LineAddedSignal.AddListener(OnLineAdded); UpdateLineSignal.AddListener(OnUpdateLineReceived); LineDeletedSignal.AddListener(OnLineDeletedReceived); View.Initialize(); }
public override async void Execute() { RTAnimationCurve rtAnimationCurve = CurveService.GetAnimationCurve(); rtAnimationCurve.ShowCurveEditor(); rtAnimationCurve.NewWindow(); AnimationCurve animationCurve = AnimationCurve.Constant(0, 1, 0.5f); switch (CurveType) { case CurveType.Animation: animationCurve = LineModel.KochLineProperty.AnimationCurve; break; case CurveType.Width: animationCurve = LineModel.WidthCurve; break; case CurveType.Lerp: animationCurve = LineModel.PhyllotaxisProperty.LerpInterpolationCurve; break; case CurveType.Scale: animationCurve = LineModel.PhyllotaxisProperty.ScaleInterpolationCurve; break; default: throw new ArgumentOutOfRangeException(); } rtAnimationCurve.Add(ref animationCurve); switch (CurveType) { case CurveType.Animation: case CurveType.Lerp: case CurveType.Scale: rtAnimationCurve.SetGradYRange(0, 1); break; case CurveType.Width: rtAnimationCurve.SetGradYRange(0, 0.5f); break; default: throw new ArgumentOutOfRangeException(); } rtAnimationCurve.SetGradXRange(0, 1); await TaskEx.WaitWhile(CurveService.IsEditorOpen); switch (CurveType) { case CurveType.Animation: LineModel.KochLineProperty.AnimationCurve = animationCurve; break; case CurveType.Width: LineModel.WidthCurve = animationCurve; break; case CurveType.Lerp: LineModel.PhyllotaxisProperty.LerpInterpolationCurve = animationCurve; break; case CurveType.Scale: LineModel.PhyllotaxisProperty.ScaleInterpolationCurve = animationCurve; break; default: throw new ArgumentOutOfRangeException(); } UpdateLineSignal.Dispatch(LineModel); }
private void OnGradientSelected(Gradient gradient) { LineModel.Gradient = gradient; UpdateLineSignal.Dispatch(LineModel); UpdateGradientSelectedSignal.Dispatch(gradient); }
private void OnColorSelected(Color color) { Value.EmissionColor = color; UpdateLineSignal.Dispatch(Value); UpdateEmissionColorSelectedSignal.Dispatch(color); }