Author Topic: Hiding Drawcalls with Scripts  (Read 4250 times)

pakkit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Hiding Drawcalls with Scripts
« on: April 16, 2014, 05:32:48 AM »
I want to hide buttons in certain conditions and trigger them to be available at certain times, How would I accomplish this? I heard you use Draw calls to do this, but how would you implement it in a script?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hiding Drawcalls with Scripts
« Reply #1 on: April 16, 2014, 11:05:54 AM »
If you want to hide something, disable the object. Don't touch draw calls.

pakkit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Hiding Drawcalls with Scripts
« Reply #2 on: April 16, 2014, 02:42:31 PM »
Ok, how do I hide the buttons?

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: Hiding Drawcalls with Scripts
« Reply #3 on: April 16, 2014, 04:04:44 PM »
Ok, how do I hide the buttons?

  1. public GameObject button01;
  2.  
  3.  
  4. public void DisableButton()
  5. {
  6.      button01.SetActive(false);
  7. }
  8.  

Just drag the Button GameObject onto the script and voila