Search Unity

Best way for making a navigation menu | (Button image swap question)

Discussion in '2D' started by Deleted User, Jan 8, 2019.

  1. Deleted User

    Deleted User

    Guest

    Hey.

    I'm trying to make an image based navigation menu where players can click on icons to go to another scene. The navigation menu needs to persist between different scenes though the icons shown can differ from scene to scene. For example, if you are in home scenes, navigation icon for Kitchen, Living Room etc will be visible but if you are in University scenes, another completely different set of icons will be shown.

    Right now, I have set it as a prefab and I modify the buttons inside it. Is that the best way of doing it?

    Second question, what will be the best way of changing button image? I know about ResourceLoad but wouldn't that be too unoptimised considering that the prefab will be getting refreshed every scene change? Is there a way to initialise ResourceLoad once and then keep the data in memory until the game closes or it is manually purged? Since the icons can change depending upon the scene, I don't know the best way of going about it.
    Should I turn the PNGs into prefabs or sprites beforehand? If yes, is there a way to have them available globally, instead of me having to place them in every scene.

    Thanks.