Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by NinjaRubberBand · Feb 06, 2017 at 09:28 PM · databaseapplicationstorage

Unity "cookbook" app recipe storage

I wanna try to make a cookbook app in unity. Right now I am trying to figure out how it all needs to work out, and i hope someone can answer some of my questions. 1. Im going to have 100+ recipes. What is the best way to storage that amout of data inside unity? Lets say that each recipe has i page with all the information, and in the homepage you can scroll through shortcuts to all the different recipes. How would i store that, in a way that i also can search through the different recipes? 2. This is a basic question. I really can't find any links on how to store information like recipes with unity. Do anyone know any tutorials on how to do it?

If you have any thoughts on the topic besides the question, feel more than free to give your thought on how it could workout!

EDIT:

The data needs to be storaged in a way, that you also can sort it by start letter etc.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Scoutas · Feb 07, 2017 at 12:32 AM

How would you store it? I think a List would be a good choice for you, but then a question rises - how could a list contain all the information that a recipe might have?

Here, I would suggest writing your own class, that could store this information. For example:

 public class Recipe{
 
     public string name;
     public List<string> ingredients = new List<String>();
 
     public List<string> GetIngredients(){
         return ingredients;
     }
 }

and then, inside the main script you would have a List of Recipe objects.

 public class MainProgram: MonoBehaviour{
 
     public List<Recipe> recipes= new List<Recipe>();
 
     public Recipe GetRecipeByIndex(int index){
         return recipes[index];
     }
 }

This, of course is just a mock-up for anything you'd want to design, but the basis is there. You could use a Dictionary, where the key would be the name of the recipe and so on.

I'll be leaving the designing of all of this to you, but that's a really basic way to do such a thing. (There are some other ways to do so, using XML files and storing the information in those, but I myself haven't had a go at those, so I don't want to misinform you. But you could try reading up on that as well.)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NinjaRubberBand · Feb 07, 2017 at 07:36 PM 0
Share

Thank you! Nice to know where to start.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

65 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Database (SQLite) Setup for Unity 0 Answers

How to store profile data in unity with firebase 0 Answers

Sq lite Date base in unity 3d? 1 Answer

Store item images in database or on device? 0 Answers

What is the best method of storing data for a weapons crafting system? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges