Version: 2018.1
public static void SetFloat (string key, float value);

Description

Назначает значение для параметра с идентификатором key.

//This script sets the float up in the PlayerPrefs to be used elsewhere. Use GetFloat to return the settings.

using UnityEngine; using UnityEngine.SceneManagement;

public class Example : MonoBehaviour { void Start() { //Give the PlayerPrefs some values to send over PlayerPrefs.SetFloat("Health", 50.0F); }

void OnGUI() { //Create a button which loads the appropriate level when you press it if (GUI.Button(new Rect(100, 200, 200, 60), "Next Scene")) { SceneManager.LoadScene("Scene2"); } } }
no example available in C#
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961