Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity UI Using one script to manage all buttons through different scenes

Discussion in 'UGUI & TextMesh Pro' started by MrHappyKiller, Jul 25, 2017.

  1. MrHappyKiller

    MrHappyKiller

    Joined:
    Feb 8, 2016
    Posts:
    29
    I would like to use my one ButtonManager script to handle all GUI buttons across scenes. For now, I just need to manage the main menu and the pause menu (both have different scenes). When thinking about it, I need to reference the buttons in order to do some things. But, if I have ButtonManager object in the first scene, I cannot (to my knowledge) reference the objects in another scene in order to manipulate them.

    tl:dr I need to use one script to manage all GUI buttons across scenes. Can't seem to reference objects of other scenes to the script. Need help.
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    Might be worth checking the Unite 2017 session on main menu's. The studio that spoke also open sourced their menu system on GitHub.
     
    LuckyMisterSleven likes this.