My Project
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Rewired.Data.RewiredInputDataStore Class Reference

Class for saving data to PlayerPrefs. Add this as a component to your Rewired Input Manager to save and load data automatically to PlayerPrefs. Copy this class and customize it to your needs to create a new custom data storage system. More...

Inheritance diagram for Rewired.Data.RewiredInputDataStore:

Public Member Functions

override void Save ()
 Save all data now.
 
override void SaveControllerData (int playerId, ControllerType controllerType, int controllerId)
 Save all data for a specific controller for a Player.
 
override void SaveControllerData (ControllerType controllerType, int controllerId)
 Save all data for a specific controller. Does not save Player data.
 
override void SavePlayerData (int playerId)
 Save all data for a specific Player.
 
override void SaveInputBehavior (int playerId, int behaviorId)
 Save all data for a specific InputBehavior for a Player.
 
override void Load ()
 Load all data now.
 
override void LoadControllerData (int playerId, ControllerType controllerType, int controllerId)
 Load all data for a specific controller for a Player.
 
override void LoadControllerData (ControllerType controllerType, int controllerId)
 Load all data for a specific controller. Does not load Player data.
 
override void LoadPlayerData (int playerId)
 Load all data for a specific Player.
 
override void LoadInputBehavior (int playerId, int behaviorId)
 Load all data for a specific InputBehavior for a Player.
 
override void SaveControllerMap (int playerId, ControllerMap controllerMap)
 Saves a Controller Map.
 
override ControllerMap LoadControllerMap (int playerId, ControllerIdentifier controllerIdentifier, int categoryId, int layoutId)
 Loads a Controller Map for a Controller.
 
void SaveAll ()
 

Public Attributes

InputSettings inputSettings
 
FilePrefs prefs
 

Protected Member Functions

override void OnInitialize ()
 Called when SaveDataStore is initialized.
 
override void OnControllerConnected (ControllerStatusChangedEventArgs args)
 Called when a controller is connected.
 
override void OnControllerPreDisconnect (ControllerStatusChangedEventArgs args)
 Calls after a controller has been disconnected.
 
override void OnControllerDisconnected (ControllerStatusChangedEventArgs args)
 Called when a controller is disconnected.
 

Properties

bool IsEnabled [get, set]
 Should this script be used? If disabled, nothing will be saved or loaded.
 
bool LoadDataOnStart [get, set]
 Should saved data be loaded on start?
 
bool LoadJoystickAssignments [get, set]
 Should Player Joystick assignments be saved and loaded? This is not totally reliable for all Joysticks on all platforms. Some platforms/input sources do not provide enough information to reliably save assignments from session to session and reboot to reboot.
 
bool LoadKeyboardAssignments [get, set]
 Should Player Keyboard assignments be saved and loaded?
 
bool LoadMouseAssignments [get, set]
 Should Player Mouse assignments be saved and loaded?
 
string PlayerPrefsKeyPrefix [get, set]
 The PlayerPrefs key prefix. Change this to change how keys are stored in PlayerPrefs. Changing this will make saved data already stored with the old key no longer accessible.
 

Detailed Description

Class for saving data to PlayerPrefs. Add this as a component to your Rewired Input Manager to save and load data automatically to PlayerPrefs. Copy this class and customize it to your needs to create a new custom data storage system.

Member Function Documentation

◆ LoadControllerData() [1/2]

override void Rewired.Data.RewiredInputDataStore.LoadControllerData ( ControllerType  controllerType,
int  controllerId 
)
inline

Load all data for a specific controller. Does not load Player data.

Parameters
controllerTypeController type
controllerIdController id

◆ LoadControllerData() [2/2]

override void Rewired.Data.RewiredInputDataStore.LoadControllerData ( int  playerId,
ControllerType  controllerType,
int  controllerId 
)
inline

Load all data for a specific controller for a Player.

Parameters
playerIdPlayer id
controllerTypeController type
controllerIdController id

◆ LoadControllerMap()

override ControllerMap Rewired.Data.RewiredInputDataStore.LoadControllerMap ( int  playerId,
ControllerIdentifier  controllerIdentifier,
int  categoryId,
int  layoutId 
)
inline

Loads a Controller Map for a Controller.

Parameters
playerIdThe Player id
controllerIdentifierController Identifier for the Controller. Get this from Controller.identifier.
categoryIdThe Map Category id of the Controller Map
layoutIdThe Layout id of the Controller Map
Returns
Controller Map

◆ LoadInputBehavior()

override void Rewired.Data.RewiredInputDataStore.LoadInputBehavior ( int  playerId,
int  behaviorId 
)
inline

Load all data for a specific InputBehavior for a Player.

Parameters
playerIdPlayer id
behaviorIdInput Behavior id

◆ LoadPlayerData()

override void Rewired.Data.RewiredInputDataStore.LoadPlayerData ( int  playerId)
inline

Load all data for a specific Player.

Parameters
playerIdPlayer id

◆ OnControllerConnected()

override void Rewired.Data.RewiredInputDataStore.OnControllerConnected ( ControllerStatusChangedEventArgs  args)
inlineprotected

Called when a controller is connected.

Parameters
argsControllerStatusChangedEventArgs

◆ OnControllerDisconnected()

override void Rewired.Data.RewiredInputDataStore.OnControllerDisconnected ( ControllerStatusChangedEventArgs  args)
inlineprotected

Called when a controller is disconnected.

Parameters
argsControllerStatusChangedEventArgs

◆ OnControllerPreDisconnect()

override void Rewired.Data.RewiredInputDataStore.OnControllerPreDisconnect ( ControllerStatusChangedEventArgs  args)
inlineprotected

Calls after a controller has been disconnected.

Parameters
argsControllerStatusChangedEventArgs

◆ SaveControllerData() [1/2]

override void Rewired.Data.RewiredInputDataStore.SaveControllerData ( ControllerType  controllerType,
int  controllerId 
)
inline

Save all data for a specific controller. Does not save Player data.

Parameters
controllerTypeController type
controllerIdController id

◆ SaveControllerData() [2/2]

override void Rewired.Data.RewiredInputDataStore.SaveControllerData ( int  playerId,
ControllerType  controllerType,
int  controllerId 
)
inline

Save all data for a specific controller for a Player.

Parameters
playerIdPlayer id
controllerTypeController type
controllerIdController id

◆ SaveControllerMap()

override void Rewired.Data.RewiredInputDataStore.SaveControllerMap ( int  playerId,
ControllerMap  controllerMap 
)
inline

Saves a Controller Map.

Parameters
playerIdThe Player id
controllerMapThe Controller Map

◆ SaveInputBehavior()

override void Rewired.Data.RewiredInputDataStore.SaveInputBehavior ( int  playerId,
int  behaviorId 
)
inline

Save all data for a specific InputBehavior for a Player.

Parameters
playerIdPlayer id
behaviorIdInput Behavior id

◆ SavePlayerData()

override void Rewired.Data.RewiredInputDataStore.SavePlayerData ( int  playerId)
inline

Save all data for a specific Player.

Parameters
playerIdPlayer id

The documentation for this class was generated from the following file: