Author Topic: Press button , picture appears!  (Read 3354 times)

aeditz50

  • Guest
Press button , picture appears!
« on: April 11, 2013, 12:45:59 PM »
How to make a button that , once it will be pressed it will activate a material/picture and then once pressed on a different button it will deactivate?
I want to create a map preview with this.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Press button , picture appears!
« Reply #1 on: April 11, 2013, 08:41:42 PM »
Write a script for it. It's like 2 lines of code.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Press button , picture appears!
« Reply #2 on: April 12, 2013, 07:33:55 PM »
Activator code:
  1. public GameObject myPicture; //set a reference in the inspector.
  2.  
  3. void OnClick()
  4. {
  5. myPicture.SetActive(true);
  6. }