Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Digitex

Coins Counter & Keeping Screen Active

Question

Hello, 

 

I'm a beginner in scripting  & unity and i'm currently facing some difficulties in a learning project i'm working on :

 

- The first one : what's the best way to keep the total amount of collected coins during game :  I mean even if the player plays so many times the same level or closes the application, i'd like a way to find the total collected coins so that i can use this informations when scripting a shoping scene 

 

- The second issue: right now, when i don't react in my game ( i don't anything ) the screen unlights and then the phone get locked in few seconds. I'd like to force the screen to be active as long as the game is running even if the player is not reacting. How can i implement that ?

 

Thanks a lot, 

 

;)

Edited by Digitex

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 1

If you want to save a value even if the application is closed, you should use PlayerPrefs.

This way you can save and load values as saved informations.

For the second issue, I assume that screen.slepTimeout = SleepTimeout.neverSleep could solve the problem ++

 

Please login or register to see this link.

Please login or register to see this link.

  • Like 1

Share this post


Link to post
Share on other sites

  • 0

You're welcome :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...