From 6eed98ff4e57326ebf7a41f0c180635a7bcac626 Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 25 Apr 2024 15:52:24 -0700 Subject: Add LTCGI Also begin trying to fix fallback shaders. --- .../Runtime/LTCGI_ExampleToggle.cs | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Third_Party/at.pimaker.ltcgi/Runtime/LTCGI_ExampleToggle.cs (limited to 'Third_Party/at.pimaker.ltcgi/Runtime/LTCGI_ExampleToggle.cs') diff --git a/Third_Party/at.pimaker.ltcgi/Runtime/LTCGI_ExampleToggle.cs b/Third_Party/at.pimaker.ltcgi/Runtime/LTCGI_ExampleToggle.cs new file mode 100644 index 0000000..290f498 --- /dev/null +++ b/Third_Party/at.pimaker.ltcgi/Runtime/LTCGI_ExampleToggle.cs @@ -0,0 +1,32 @@ +#if UDONSHARP +using UdonSharp; +using UnityEngine.Serialization; + +// NOTE: This script has to be in the "_LTCGI/Scripts" folder, *or* reference +// the "LTCGI_AssemblyUdon" to allow it to use the "LTCGI_UdonAdapter" type! + +[UdonBehaviourSyncMode(BehaviourSyncMode.None)] +public class LTCGI_ExampleToggle : UdonSharpBehaviour +{ + // set this to your controller object (specifically the adapter object): + [FormerlySerializedAs("Adapter")] + public LTCGI_UdonAdapter LTCGI_Controller; + + // set this however you want: + public bool StartingState = true; + private bool state; + + void Start() + { + state = StartingState; + LTCGI_Controller._SetGlobalState(state); + } + + // you can make this a UI event as well! + public override void Interact() + { + state = !state; + LTCGI_Controller._SetGlobalState(state); + } +} +#endif \ No newline at end of file -- cgit v1.2.3