Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by allesisda · Mar 06, 2014 at 12:23 AM · guimobilepuzzlebatterypower

Mobile render when click

Hey there,

i am working on a sudoku-like puzzlegame for android and my phone is getting very hot.

the screen only changes if the user touch a GUIButton, so i don't even need to render all the time. is it possible to make something like "render on click" or "doRenderNow();" ?

do you have an idea?

i also think that reducing the framerate should increase the battery lifetime. am i right?

thanks for your help!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by fifthknotch · Mar 06, 2014 at 04:39 AM

I haven't ever tried anything like "render on click", but let me be the first to tell you that OnGUI is horrible about eating up processing power, ESPECIALLY on mobile devices. Before making your game update only when touching the screen, try changing your GUI buttons into gameObjects that detect touch input. From there you can move your code under Update functions or even better OnTrigger functions.

Hope this helps!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image allesisda · Mar 06, 2014 at 12:29 PM 0
Share

okay that is really stupid... why is gui so inefficient? -.- so i am supposed to use 3d objects to make a 2d game... awesome..

i have a field beeing build with for() and making that with gameobjects would be much more difficult...

maybe i should build a selfmade "guiSystem" wich works more efficiently... would you have an idea how i could do that without gameobjects?`

avatar image fifthknotch · Mar 07, 2014 at 05:17 AM 0
Share

I have used triggers over my buttons on my mobile apps. They work the same way. Just have the trigger look for touch input through an if statement and put the remaining code inside the if. Unfortunately, if you have created custom GUI styles and skins, creating new game objects can become a huge hassle. But at least you know now for in the future.

avatar image
0

Answer by Sisso · Mar 06, 2014 at 12:47 PM

It is possible, for example by using camera.clearFlags. Each time that you change stuff, you create the object, draw it and delete or disable.

Because directly control of canvas and game loop is not the main point of the engine, go on this path will not be easy. Consider to use another game engine could be better to your game.

About the gui, like @fifthknotch said currently unity3d build-in gui is terrible. Personally I am very happy with ngui, give it a try.

Reduce gameobjects generally do nothing. Never optimize before profile, generally is a lost of time and increase code complexity.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make a GUI to show how much battery is left on Flashlight? 1 Answer

How to position elements on scene 0 Answers

Why this simple code doesnt work? 0 Answers

How do you write a Pauseable-Timer Script in Unity JavaScript? 1 Answer

Blurry Text using Textmesh Pro on android device 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges