Author Topic: [Solved]HowTo Display PlayerPrefs via JavaScript on a Label  (Read 2115 times)

EW

  • Guest
Hey,

I just changed from OnGUI to NGUI and it is absolute fantastic how fast you can work with NGUI, but now I ran into a problem...

How can I display data stored in PlayerPrefs on a Label? The information available for using Playerprefs is very limited on the NGUIForum and the Example & Tutorial Scenes that come with NGUI also do not explain how to use it.

At last I need to admit that I am not a very good coder, maybe it is so easy that I´ve just overlooked it.


Thanks in advance EW
« Last Edit: June 25, 2013, 01:17:07 PM by EW »

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: HowTo Display PlayerPrefs via JavaScript on a Label
« Reply #1 on: June 25, 2013, 08:21:34 AM »
Sorry to say you do not need to be a good code to use the documentation.

  1. label.text = PlayerPrefs.GetString("Player Name");

http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html

http://www.tasharen.com/ngui/docs/class_u_i_label.html#a0f23864c73c5a5af4e944dcd9d5aa9fd

EW

  • Guest
Re: HowTo Display PlayerPrefs via JavaScript on a Label
« Reply #2 on: June 25, 2013, 01:16:20 PM »
Thanks Malzbier,
Quote
label.text = PlayerPrefs.WhatEver

was what I searched for, I saw http://www.tasharen.com/ngui/docs/class_u_i_label.html#a0f23864c73c5a5af4e944dcd9d5aa9fd but it was unclear to me(maybe I need to correct, I am really shitty at coding :) )