Class SettingsUIHandler
Controls the setting panel.
Inheritance
SettingsUIHandler
Namespace: AS2.UI
Assembly: .dll
Syntax
public class SettingsUIHandler : MonoBehaviour
Fields
camPosInGridCoords
Declaration
private bool camPosInGridCoords
Field Value
nonFullScreenResolution
Declaration
private Vector2Int nonFullScreenResolution
Field Value
Type |
Description |
Vector2Int |
|
settingName_animationsOnOff
Declaration
private const string settingName_animationsOnOff = "Animations On/Off"
Field Value
settingName_beepFailureProb
Declaration
private const string settingName_beepFailureProb = "Beep Failure Prob."
Field Value
settingName_cameraAngle
Declaration
private const string settingName_cameraAngle = "Camera Angle"
Field Value
settingName_cameraPosWorldOrGrid
Declaration
private const string settingName_cameraPosWorldOrGrid = "Grid Coordinates"
Field Value
settingName_cameraPosX
Declaration
private const string settingName_cameraPosX = "Camera Pos. X"
Field Value
settingName_cameraPosY
Declaration
private const string settingName_cameraPosY = "Camera Pos. Y"
Field Value
settingName_cameraSize
Declaration
private const string settingName_cameraSize = "Camera Size"
Field Value
settingName_circuitBorder
Declaration
private const string settingName_circuitBorder = "Circuit Border"
Field Value
settingName_circularRing
Declaration
private const string settingName_circularRing = "Circular Ring"
Field Value
settingName_compassOvArrows
Declaration
private const string settingName_compassOvArrows = "Compass Ov. Arrows"
Field Value
settingName_fullscreen
Declaration
private const string settingName_fullscreen = "Fullscreen"
Field Value
Declaration
private const string settingName_toggleTooltips = "Tooltips"
Field Value
setting_beepFailureProb
Declaration
private UISetting_Text setting_beepFailureProb
Field Value
setting_cameraPosX
Declaration
private UISetting_Text setting_cameraPosX
Field Value
setting_cameraPosY
Declaration
private UISetting_Text setting_cameraPosY
Field Value
setting_cameraSize
Declaration
private UISetting_Text setting_cameraSize
Field Value
settingsPanel
Declaration
public GameObject settingsPanel
Field Value
Type |
Description |
GameObject |
|
settingsParent
Declaration
public GameObject settingsParent
Field Value
Type |
Description |
GameObject |
|
uiHandler
Declaration
private UIHandler uiHandler
Field Value
Methods
Reads the current position and size values from the
Settings Panel and applies them to the camera.
Declaration
private void Button_CameraApply()
Stores the current settings in the configuration and
saves the config file.
Declaration
private void Button_SaveSettings()
Activates/Deactivates the settings panel depending on its active state.
Connected to the Settings button in the Scene.
Declaration
public void Button_SettingsPressed()
Close()
Closes the settings panel.
Declaration
InitSettings()
Initializes the settings UI. Dynamically sets up all the settings with all their input fields.
Initial values are loaded from the configuration file if they are not available elsewhere.
Declaration
private void InitSettings()
SettingChanged_BeepFailureProb(string, string)
Declaration
private void SettingChanged_BeepFailureProb(string name, string value)
Parameters
SettingChanged_Dropdown(string, string)
Called by a setting callback when a setting has been changed.
Declaration
private void SettingChanged_Dropdown(string name, string value)
Parameters
Type |
Name |
Description |
string |
name |
The name of the changed setting.
|
string |
value |
The setting's new string value.
|
SettingChanged_Text(string, string)
Called by a setting callback when a setting has been changed.
Declaration
private void SettingChanged_Text(string name, string text)
Parameters
Type |
Name |
Description |
string |
name |
The name of the changed setting.
|
string |
text |
The setting's new string value.
|
SettingChanged_Toggle(string, bool)
Called by a setting callback when a setting has been changed.
Declaration
private void SettingChanged_Toggle(string name, bool isOn)
Parameters
Type |
Name |
Description |
string |
name |
The name of the changed setting.
|
bool |
isOn |
The setting's new bool value.
|
SettingChanged_Value(string, float)
Called by a setting callback when a setting has been changed.
Declaration
private void SettingChanged_Value(string name, float value)
Parameters
Type |
Name |
Description |
string |
name |
The name of the changed setting.
|
float |
value |
The setting's new float value.
|
Start()
Declaration
ToggleCamPositionWorldGrid(bool)
Changes the displayed camera coordinates to be
world or grid coordinates.
Declaration
private void ToggleCamPositionWorldGrid(bool grid)
Parameters
Type |
Name |
Description |
bool |
grid |
If true , display grid
coordinates, otherwise display world coordinates.
|
UpdateCameraData(float, float, float)
Updates the fields related to the camera position and
size in the Settings Panel.
Declaration
public void UpdateCameraData(float x, float y, float size)
Parameters
Type |
Name |
Description |
float |
x |
The x world coordinate of the camera.
|
float |
y |
The y world coordinate of the camera.
|
float |
size |
The orthographic size of the camera.
|