C# Class RoadNamer.Managers.OptionsManager

Manages all ingame options. Handles the interface between ingame options storage and saving/loading from disk.
Inheritance: UnityEngine.MonoBehaviour
ファイルを表示 Open project: PropaneDragon/RoadNamer Class Usage Examples

Public Properties

Property Type Description
m_build int
m_hasOpenedPanel bool
m_isIngame bool
m_major int
m_minor int
m_randomNamesLocation string
m_revision int
m_spritesLocation string
m_versionStringFull string
m_workshopId uint

Public Methods

Method Description
CreateOptions ( UIHelperBase helper ) : void

Creates options on a panel using the helper

GetCheckBoxValue ( string uniqueName, bool &returnValue ) : bool

Gets a bool from an option that was set using a checkbox

GetDropdownValue ( string uniqueName, int &returnValue ) : bool

Gets a string from an option that was set using a dropdown

GetDropdownValue ( string uniqueName, string &returnValue ) : bool

Gets a string from an option that was set using a dropdown

GetSliderValue ( string uniqueName, float &returnValue ) : bool

Gets a float from an option that was set using a slider

LoadOptions ( ) : void

Load options from disk and replace default values with stored ones.

Populate ( ) : void

Populates everything that needs any additional data loading

SaveOptions ( ) : void

Save options to disk

UpdateEverything ( ) : void

Updates everything ingame. Should be used when one of the options has updated and ingame elements need immediately refreshing.

Private Methods

Method Description
CheckBox_eventCheckChanged ( UIComponent component, bool value ) : void
Dropdown_eventSelectedIndexChanged ( UIComponent component, int value ) : void
OptionChanged ( bool value ) : void
OptionChanged ( float value ) : void
OptionChanged ( int sel ) : void
SaveButtonClicked ( ) : void
Slider_eventValueChanged ( UIComponent component, float value ) : void

Method Details

CreateOptions() public method

Creates options on a panel using the helper
public CreateOptions ( UIHelperBase helper ) : void
helper UIHelperBase The UIHelper to put the options on
return void

GetCheckBoxValue() public static method

Gets a bool from an option that was set using a checkbox
public static GetCheckBoxValue ( string uniqueName, bool &returnValue ) : bool
uniqueName string The unique name of the checkbox option
returnValue bool The value to replace
return bool

GetDropdownValue() public static method

Gets a string from an option that was set using a dropdown
public static GetDropdownValue ( string uniqueName, int &returnValue ) : bool
uniqueName string The unique name of the dropdown option
returnValue int The value to replace
return bool

GetDropdownValue() public static method

Gets a string from an option that was set using a dropdown
public static GetDropdownValue ( string uniqueName, string &returnValue ) : bool
uniqueName string The unique name of the dropdown option
returnValue string The value to replace
return bool

GetSliderValue() public static method

Gets a float from an option that was set using a slider
public static GetSliderValue ( string uniqueName, float &returnValue ) : bool
uniqueName string The unique name of the slider option
returnValue float The value to replace
return bool

LoadOptions() public static method

Load options from disk and replace default values with stored ones.
public static LoadOptions ( ) : void
return void

Populate() public static method

Populates everything that needs any additional data loading
public static Populate ( ) : void
return void

SaveOptions() public static method

Save options to disk
public static SaveOptions ( ) : void
return void

UpdateEverything() public static method

Updates everything ingame. Should be used when one of the options has updated and ingame elements need immediately refreshing.
public static UpdateEverything ( ) : void
return void

Property Details

m_build public_oe static_oe property

public static int m_build
return int

m_hasOpenedPanel public_oe static_oe property

public static bool m_hasOpenedPanel
return bool

m_isIngame public_oe static_oe property

public static bool m_isIngame
return bool

m_major public_oe static_oe property

public static int m_major
return int

m_minor public_oe static_oe property

public static int m_minor
return int

m_randomNamesLocation public_oe static_oe property

public static string m_randomNamesLocation
return string

m_revision public_oe static_oe property

public static int m_revision
return int

m_spritesLocation public_oe static_oe property

public static string m_spritesLocation
return string

m_versionStringFull public_oe static_oe property

public static string m_versionStringFull
return string

m_workshopId public_oe static_oe property

public static uint m_workshopId
return uint