i want to make a control of my game and save it
my game have 3 different controls
so if player enter the game and had choose a control
it must save this control as default control for the game
when he open the game any time again he should find the control he choose before as a default
can you help me ?
You can user PlayerPrefs to store and retrieve information across play sessions.
Once the player has chosen his control option you could save that selection using some sort of integer value, e.g:
public enum ControlOption
{
Joystick,
Keyboard,
Mouse
}
public void SetPlayerControls(ControlOption option)
{
switch (option)
{
//TODO: Control code here.
}
PlayerPrefs.SetInt("control_options", (int)option);
}
Then when you want to load that information simply:
SetPlayerControls(PlayerPrefs.GetInt("control_options", (int)ControlOptions.Keyboard);
The ControlOptions.Keyboard used here would be a default value should you not have any initial value set.