playMaker

Author Topic: Sound Toggle Playerpref  (Read 2059 times)

PlaymakerNovice

  • Playmaker Newbie
  • *
  • Posts: 18
Sound Toggle Playerpref
« on: October 23, 2015, 10:08:15 AM »
I have a sound toggle button in my game but I want to know how to keep it in it's state even when the game is closed, so when the player opens the game again the sound stays off or on, whichever they chose, and they don't have to change the option again.
« Last Edit: October 23, 2015, 10:22:53 AM by PlaymakerNovice »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sound Toggle Playerpref
« Reply #1 on: October 23, 2015, 02:09:36 PM »
Hi,
you can use the custom action "Playerprefs bool test" and "playerprefs set bool"
you can find them on the EcoSystem

at the start of your game you need to use the bool test to see if true or false
and set sound according the result.
on the button you can also do the bool test when clicked and when true set bool to false and vice-versa

or you can use playerprefs get/set int actions and a int switch action
with the same principals using 0 and 1