playMaker

Author Topic: PlayerPrefs extension  (Read 7444 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
PlayerPrefs extension
« on: May 22, 2013, 03:41:46 AM »
Hi Everyone,

 Following a request, please find an extension of the PlayerPrefs system to accept more types:

  • Int
  • Float
  • Bool
  • Color
  • Quaternion
  • Rect
  • Vector2
  • Vector3
  • String


https://hutonggames.fogbugz.com/default.asp?W1118

bye,

 Jean
« Last Edit: May 29, 2013, 01:13:01 AM by jeanfabre »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: PlayerPrefs extension
« Reply #1 on: May 22, 2013, 04:22:20 AM »
Awesome!

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: PlayerPrefs extension
« Reply #2 on: May 24, 2013, 10:42:00 AM »
PlayerPrefs Set/Get Bool would be useful.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayerPrefs extension
« Reply #3 on: May 29, 2013, 01:09:25 AM »
Hi,

 Bool is available, sorry for not having properly listed what's available :)

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: PlayerPrefs extension
« Reply #4 on: May 31, 2013, 06:28:12 AM »
Ok, I've imported it in but I get these messages.

Assets/PlayMaker/PlayerPrefsx/PlayerPrefsxGetValue.cs(25,48): warning CS0219: The variable `key' is assigned but its value is never used

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(23,48): warning CS0219: The variable `key' is assigned but its value is never used

And when I re-open Unity the Playmaker menu is gone. Do I need to put the scripts in the Playmaker folder that was already present?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayerPrefs extension
« Reply #5 on: May 31, 2013, 06:31:12 AM »
Hi,
 
don't worry, it's harmless. I will get rid of them on the next update.

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: PlayerPrefs extension
« Reply #6 on: July 01, 2013, 06:10:03 AM »
I tried importing the PlayerPrefs actions again and it didn't work. I saw that 1.6 is out so I downloaded that and I have the same problems.

I get a whole host of errors and when I restart Unity the Playmaker Menu is missing.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayerPrefs extension
« Reply #7 on: July 01, 2013, 07:32:13 AM »
Hi,

 What errors do you get?

As for the unity menu not appearing, simply press pla, it usually refreshes Unity Menu system.

bye,

 Jean

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: PlayerPrefs extension
« Reply #8 on: July 09, 2013, 09:33:30 AM »
Ok I imported 1.6.2 and couldn't find the new PlayerPrefs so imported the package at the top of the this page.

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(54,106): error CS0103: The name `PlayMakerUtils' does not exist in the current context

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(54,69): error CS1502: The best overloaded method match for `UnityEngine.PlayerPrefs.SetInt(string, int)' has some invalid arguments

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(54,69): error CS1503: Argument `#2' cannot convert `object' expression to type `int'

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(57,111): error CS0103: The name `PlayMakerUtils' does not exist in the current context

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(57,69): error CS1502: The best overloaded method match for `UnityEngine.PlayerPrefs.SetFloat(string, float)' has some invalid arguments

Assets/PlayMaker Custom Actions/PlayerPrefsx/PlayerPrefxSetValue.cs(57,69): error CS1503: Argument `#2' cannot convert `object' expression to type `float'

I get 27 errors like this, what should do?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayerPrefs extension
« Reply #9 on: July 10, 2013, 08:58:49 AM »
Hi,

 Sorry, I forgot to mention ArrayMaker is needed. I updated the wiki to mention it.

https://hutonggames.fogbugz.com/default.asp?W715

Bye,

 Jean