public static object GetSelectionEnum(string key, System.Type enumType) { string t_key = enumType.ToString() + key; int modeId = PlayerPrefsExtra.GetInt(t_key); return((Enum.GetValues(enumType)).GetValue(modeId)); }
void Start() { if (PlayerPrefsExtra.HasKey("connect_IP")) { connectToIP = PlayerPrefsExtra.GetString("connect_IP"); } if (PlayerPrefsExtra.HasKey("connect_Port")) { connectPort = PlayerPrefsExtra.GetInt("connect_Port"); autoConnect = (PlayerPrefsExtra.GetInt("connect_autoConnect") == 1); } if (PlayerPrefsExtra.HasKey("connect_sendRate")) { sendRate = PlayerPrefsExtra.GetInt("connect_sendRate"); Network.sendRate = sendRate; } if (autoConnect) { isServer = (PlayerPrefsExtra.GetInt("connect_isServer") == 1) ? true : false; if (isServer) { connectAsServer(); } else { connectAsClient(); } } }
public static bool GetBool(string key) { int v = PlayerPrefsExtra.GetInt(key); return((v == 1) ? true : false); }