A game about forced loneliness, made by TACStudios
1using UnityEngine;
2
3namespace Unity.VisualScripting
4{
5 [Widget(typeof(ValueInput))]
6 public class ValueInputWidget : UnitInputPortWidget<ValueInput>
7 {
8 public ValueInputWidget(FlowCanvas canvas, ValueInput port) : base(canvas, port)
9 {
10 color = ValueConnectionWidget.DetermineColor(port.type);
11 }
12
13 protected override bool showInspector => port.hasDefaultValue && !port.hasValidConnection;
14
15 protected override bool colorIfActive => !BoltFlow.Configuration.animateControlConnections || !BoltFlow.Configuration.animateValueConnections;
16
17 public override Color color { get; }
18
19 protected override Texture handleTextureConnected => BoltFlow.Icons.valuePortConnected?[12];
20
21 protected override Texture handleTextureUnconnected => BoltFlow.Icons.valuePortUnconnected?[12];
22
23 public override Metadata FetchInspectorMetadata()
24 {
25 if (port.hasDefaultValue)
26 {
27 return metadata["_defaultValue"].Cast(port.type);
28 }
29 else
30 {
31 return null;
32 }
33 }
34 }
35}