PlayerPrefs存储数据在本地的存储位置

来源:互联网 发布:h3c 添加免认证mac 编辑:程序博客网 时间:2024/06/02 04:36

在unity中会使用到这个PlayerPrefs进行持久化的小的数据,在经过保存之后,这个值到底存放在哪里呢? 
本文主要讲述了如何找到这个文件。 
1、使用如下的代码: 
这里写图片描述

using UnityEngine;using System.Collections;using System.Net;using System.ComponentModel;public class NewBehaviourScript : MonoBehaviour {    /// <summary>    /// 写入    /// </summary>    public void Write()    {        PlayerPrefs.SetString("name","xiaoming");        PlayerPrefs.SetInt("age", 12);    }    /// <summary>    /// 读取    /// </summary>    public void Read()    {        Debug.Log(PlayerPrefs.GetString("name"));        Debug.Log(PlayerPrefs.GetInt("age"));    }}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

2、打开注册表:regedit

3、打开Unity中Edit-》Project Settings-》Player 
这里写图片描述

4、在注册表中找到这个值: 
这里写图片描述

原文链接:http://blog.csdn.net/wodownload2/article/details/51955237

0 0