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 Computerkid23 · Nov 05, 2013 at 07:09 PM · c#androidmobile

how would i enable button every X amount of points

hey guy so i have a piece of code i wrote to allow my "special" button to activate once over a certain amount of point thing is once its activated you can keep using it and i want it to activate accept a press then deactivate till the next, lets say 1000 points is this possible can some one what can be used to portray this?

here is the function i want activated every 1000 pts and it should deactivate once pressed(its tied to a guitexture button on touch screen):

 IEnumerator SloMo()
     {    
         if(Time.timeScale == 1.0f)
         {
             Time.timeScale = newTimeScale;
             
             Time.fixedDeltaTime = Time.fixedDeltaTime/slowFactor;
                     
             Time.maximumDeltaTime = Time.maximumDeltaTime/slowFactor;
         }
         yield return new WaitForSeconds(0.5f);
         
         if(Time.timeScale == newTimeScale)
         {
             Time.timeScale = 1.0f;  
             Time.fixedDeltaTime = Time.fixedDeltaTime*slowFactor;  
             Time.maximumDeltaTime = Time.maximumDeltaTime*slowFactor;
             
             special.enabled = false;
         }
         
         
     }    
 
Comment
Add comment · Show 2
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 rutter · Nov 05, 2013 at 07:16 PM 0
Share

How is your button being drawn? Is it a GUI.Button() call? If so, enabling/disabling the button is ultimately a question of whether or not you make that call. Is it a GameObject? If so, you could call SetActive() on it.

avatar image Computerkid23 · Nov 05, 2013 at 08:29 PM 0
Share

yea its an actual gameobject (Gameobject --> Create other --> GUI Texture

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Computerkid23 · Nov 05, 2013 at 08:41 PM

ahhh ok i dont know if this is the best way but i figured it out

 public GUITexture SlowMO;
 
 void Start()
 {
   SlowMo.enable = false;
 }

for some reason .SetActive wasnt working for me

thanks guys

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
avatar image
0

Answer by Starwalker · Nov 05, 2013 at 07:36 PM

special.SetActive() = false;

Comment
Add comment · Show 1 · 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 Computerkid23 · Nov 05, 2013 at 08:35 PM 0
Share

This is what i used before but i gives me this error:

The left-hand side of an assignment must be a variable, a property or indexer

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

17 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

Related Questions

Android File-io? 1 Answer

Unity and ARMv6 with VFP, how to downgrade from Unity 4.x to Unity 3.5.x? How to use both Unity without errors and issues? 2 Answers

Simple Unity3d Facebook Integration? 1 Answer

How to run unity app like a "live wallpaper" on android? 0 Answers

Android Native Plugin (NOT WORKING) 1 Answer


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