-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathTimeNodeViewModel.cs
More file actions
32 lines (28 loc) · 920 Bytes
/
TimeNodeViewModel.cs
File metadata and controls
32 lines (28 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Text;
using DynamicData;
using ExampleShaderEditorApp.Model;
using NodeNetwork.Views;
using ReactiveUI;
namespace ExampleShaderEditorApp.ViewModels.Nodes
{
public class TimeNodeViewModel : ShaderNodeViewModel
{
static TimeNodeViewModel()
{
Splat.Locator.CurrentMutable.Register(() => new NodeView(), typeof(IViewFor<TimeNodeViewModel>));
}
public ShaderNodeOutputViewModel Result { get; } = new ShaderNodeOutputViewModel();
public TimeNodeViewModel()
{
this.Name = "Time";
this.Category = NodeCategory.Misc;
Result.Name = "Seconds";
Result.ReturnType = typeof(float);
Result.Value = Observable.Return(new ShaderFunc(() => "seconds"));
EditableOutputs().Add(Result);
}
}
}