Unity - Scripting API: EditorPrefs.GetFloat
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Declaration
public static float GetFloat(string key);
Declaration
public static float GetFloat(string key, float defaultValue = 0.0F);
Parameters
| Parameter | Description |
|---|---|
| key | Name of key to read float from. |
| defaultValue | Float value to return if the key is not in the storage. |
Returns
float The float value stored in the preference file or the defaultValue id the requested float does not exist.
Description
Returns the float value corresponding to key if it exists in the preference file.
If GetFloat does not exist in the Preference file the defaultValue will
be returned.