Вот как я сохраняю:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Menu : MonoBehaviour
{
void Start()
{
if (!PlayerPrefs.HasKey("Sensitivity"))
{
PlayerPrefs.SetFloat("Sensitivity", 1f);
}
PlayerPrefs.Save();
}
public void OnSensChange(float value)
{
PlayerPrefs.SetFloat("Sensitivity", value);
PlayerPrefs.Save();
}
}
И загружаю (в другой сцене):
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Player : MonoBehaviour
{
private float Sensitivity;
private void Awake()
{
Sensitivity = PlayerPrefs.GetFloat("Sensitivity");
PlayerPrefs.Save();
}
}
И значение не сохраняется.