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. Dismiss Notice

Question Storing levels data

Discussion in 'Scripting' started by kwadratztylka, Sep 15, 2023.

  1. kwadratztylka

    kwadratztylka

    Joined:
    May 12, 2023
    Posts:
    2
    (English isn't my first language so excuse me if something sounds weird. This is my first post here, I hope it is in right cathegory)

    Hello,
    I'm making a game: There are 30 days (levels). Each day player has to complete some mini-games (number of them vary). I want to store somewhere how many and which minigames each day has and some other variables to them (for example how much time player has to complete minigame). I have minigames each in separate scenes. I'm not sure how to approach problem of storing all this information about days. I was researching about scriptable objects, it seems like a decent way to approach this, but also seems like very storage heavy to have 30 different objects. If there is a better way, I would greatly appreciate any links to documentations, tutorials etc.
    Thanks in advance
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    ScriptableObjects are perfect for this.

    I would make a type that stores info about a MiniGame

    Then I would make a type that accepts a list of MiniGame objects.

    We have over 16,000 different ScriptableObjects in my current project. This is fine.

    Here's more information:

    ScriptableObject usage in RPGs:

    https://forum.unity.com/threads/scr...tiple-units-in-your-team.925409/#post-6055289

    https://forum.unity.com/threads/cre...ssigned-in-the-inspector.946240/#post-6174205

    Usage as a shared common data container:

     
    kwadratztylka likes this.
  3. kwadratztylka

    kwadratztylka

    Joined:
    May 12, 2023
    Posts:
    2
    Thank you, I'll try to implement this idea to my game