A game about forced loneliness, made by TACStudios
1using System;
2using UnityEditor.ShaderGraph.Drawing.Slots;
3using UnityEditor.ShaderGraph.Internal;
4using UnityEngine.UIElements;
5
6namespace UnityEditor.ShaderGraph
7{
8 [Serializable]
9 class ViewDirectionMaterialSlot : SpaceMaterialSlot, IMayRequireViewDirection
10 {
11 public ViewDirectionMaterialSlot()
12 { }
13
14 public ViewDirectionMaterialSlot(int slotId, string displayName, string shaderOutputName, CoordinateSpace space,
15 ShaderStageCapability stageCapability = ShaderStageCapability.All, bool hidden = false)
16 : base(slotId, displayName, shaderOutputName, space, stageCapability, hidden)
17 { }
18 public override VisualElement InstantiateControl()
19 {
20 return new LabelSlotControlView(space + " Space");
21 }
22
23 public override string GetDefaultValue(GenerationMode generationMode)
24 {
25 return string.Format("IN.{0}", space.ToVariableName(InterpolatorType.ViewDirection));
26 }
27
28 public NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCapability)
29 {
30 if (isConnected)
31 return NeededCoordinateSpace.None;
32 return space.ToNeededCoordinateSpace();
33 }
34 }
35}