using SHADE; using SHADE_Scripting.UI; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class InverseCamera : Script { public bool inverseX = false; public bool inverseY = false; protected override void awake() { UIElement ui = GetComponent(); if (ui) { Toggle toggle = ui.GetComponent(); if(inverseX) toggle.SetValue(Settings.inverseX); if(inverseY) toggle.SetValue(Settings.inverseY); } else { Debug.LogError("Failed to register Toggle action for inverse"); } } protected override void start() { UIElement ui = GetComponent(); if (ui) { ui.OnClick.RegisterAction(() => { Toggle toggle = ui.GetComponent(); if(inverseX) Settings.inverseX = toggle.GetValue(); if(inverseY) Settings.inverseY = toggle.GetValue(); }); } else { Debug.LogError("Failed to register Toggle action for inverse"); } } }