Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Build a world map with showing player's progress

Discussion in 'Scripting' started by AlreadyInUse, Jul 7, 2018.

  1. AlreadyInUse

    AlreadyInUse

    Joined:
    Mar 21, 2013
    Posts:
    12
    I am building a World Map as a separate scene for my mobile game. This scene shows World Map with Key Points which Player should pass to make a progress. Points are shown in black/white by default and change to colored image when passed. The total number of Key Points are about 400.

    I attached a screenshot with a piece of map. In the bottom right corner are 3 passed points (colored) other are black/white.

    My question is: what is the recommended approach to check for Point's status and change its image to colored considering that this is a game for mobile and we have about 400 game objects?
    Note: we only have to do this once on scene load.

    The first idea was to have each point as a separate UI Game Object with an Image component attached and a MonoBehaviour script. The script would hold references to both sprites (black/white and colored), check the status of the Point in Start() and choose the correct sprite for the Point.

    I am not sure if this is a good idea to have 400 MonoBehaviours in one scene, even though they will not do any Update(), only quick check in Start(). I would be more confident, but I don't know how to profile this approach and will appreciate any advice here as well.
     

    Attached Files:

  2. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Well, what I ended up doing for a client game was just setting each one as a level, and making it so they couldn't go further than the level they completed. Each box/visual tile on the pathway had a little trigger box collider that the player tapped, and it had a little script with parameters for the level number, name, scene name to load, etc. I just used two different sprites, one for completed, one for incomplete. Worked fine. Just changed the sprite when I needed to and saved it.
     
    AlreadyInUse likes this.
  3. AlreadyInUse

    AlreadyInUse

    Joined:
    Mar 21, 2013
    Posts:
    12
    How many visual tiles did you have on your pathway?