PlayerPrefs.SetInt 设置整数键值

static function SetInt (key : string, value : int) : void

Description描述

Sets the value of the preference identified by key.

设置由key确定的参数值。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		PlayerPrefs.SetInt("Player Score", 10);
	}
}
PlayerPrefs.SetInt("Player Score", 10);
Page last updated: 2012-5-27