2023-03-25 02:38:56 +08:00
|
|
|
|
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;
|
|
|
|
|
|
2023-03-25 15:52:22 +08:00
|
|
|
|
|
2023-03-25 02:38:56 +08:00
|
|
|
|
protected override void awake()
|
|
|
|
|
{
|
|
|
|
|
UIElement ui = GetComponent<UIElement>();
|
|
|
|
|
if (ui)
|
|
|
|
|
{
|
|
|
|
|
Toggle toggle = ui.GetComponent<Toggle>();
|
|
|
|
|
|
|
|
|
|
if(inverseX)
|
|
|
|
|
toggle.SetValue(Settings.inverseX);
|
|
|
|
|
if(inverseY)
|
|
|
|
|
toggle.SetValue(Settings.inverseY);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("Failed to register Toggle action for inverse");
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-25 15:52:22 +08:00
|
|
|
|
protected override void update()
|
2023-03-25 02:38:56 +08:00
|
|
|
|
{
|
|
|
|
|
UIElement ui = GetComponent<UIElement>();
|
|
|
|
|
if (ui)
|
|
|
|
|
{
|
2023-03-25 15:52:22 +08:00
|
|
|
|
Toggle toggle = ui.GetComponent<Toggle>();
|
|
|
|
|
|
|
|
|
|
if (inverseX)
|
|
|
|
|
Settings.inverseX = toggle.GetValue();
|
|
|
|
|
if (inverseY)
|
|
|
|
|
Settings.inverseY = toggle.GetValue();
|
2023-03-25 02:38:56 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.LogError("Failed to register Toggle action for inverse");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|