A game about forced loneliness, made by TACStudios
1using System.Reflection;
2using UnityEngine;
3
4namespace UnityEditor.ShaderGraph
5{
6 [Title("Input", "Lighting", "Main Light Direction")]
7 class MainLightDirectionNode : CodeFunctionNode
8 {
9 public MainLightDirectionNode()
10 {
11 name = "Main Light Direction";
12 synonyms = new string[] { "sun" };
13 }
14
15 public override bool hasPreview { get { return false; } }
16
17 protected override MethodInfo GetFunctionToConvert()
18 {
19 return GetType().GetMethod("MainLightDirection", BindingFlags.Static | BindingFlags.NonPublic);
20 }
21
22 static string MainLightDirection([Slot(0, Binding.None)] out Vector3 Direction)
23 {
24 Direction = Vector3.one;
25 return
26@"
27{
28 #if SHADERGRAPH_PREVIEW
29 Direction = half3(-0.5, -0.5, 0);
30 #else
31 Direction = SHADERGRAPH_MAIN_LIGHT_DIRECTION();
32 #endif
33}
34";
35 }
36 }
37}