A game about forced loneliness, made by TACStudios
at master 1.2 kB view raw
1using System; 2using UnityEditor.ShaderGraph.Drawing.Slots; 3using UnityEditor.ShaderGraph.Internal; 4using UnityEngine.UIElements; 5 6namespace UnityEditor.ShaderGraph 7{ 8 [Serializable] 9 class PositionMaterialSlot : SpaceMaterialSlot, IMayRequirePosition 10 { 11 public PositionMaterialSlot() 12 { } 13 14 public PositionMaterialSlot(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 19 public override VisualElement InstantiateControl() 20 { 21 return new LabelSlotControlView(space + " Space"); 22 } 23 24 public override string GetDefaultValue(GenerationMode generationMode) 25 { 26 return string.Format("IN.{0}", space.ToVariableName(InterpolatorType.Position)); 27 } 28 29 public NeededCoordinateSpace RequiresPosition(ShaderStageCapability stageCapability) 30 { 31 if (isConnected) 32 return NeededCoordinateSpace.None; 33 return space.ToNeededCoordinateSpace(); 34 } 35 } 36}