Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 faryar76_unity · Mar 13, 2020 at 10:11 AM · jsonresources.loadlevel-designlevel editorresource

can use resource.load to load levels(json file)?

Hi guys, i made a level builder with untiy (with editor window api) that saves objetcts positions as level in json file

1-Is this okay(this style)?
2-Is it okay to load the levels with resource.load?it will have memory issue?

Comment
Add comment · Show 3
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 Hellium · Mar 13, 2020 at 12:16 PM 1
Share

https://learn.unity.com/tutorial/assets-resources-and-assetbundles#5c7f8528edbc2a002053b5a7

The Resources folder

3.1. Best Practices for the Resources System

Don't use it.


In your situation, I believe there are other ways to handle your JSON file.

I have one question: why do you want to use the Resources folder?

avatar image faryar76_unity Hellium · Mar 13, 2020 at 03:32 PM 0
Share

i made a level builder. my level builder will save objects positions... as a json file somewhere "in my case in Resources"
cause after build client able to read it.
can i save in other folder ? and then access it after build?

Note:its not a runtime level maker its a window editor level editor. i want make level and put them in app before user install it

avatar image Hellium faryar76_unity · Mar 13, 2020 at 07:54 PM 0
Share

If the file is not meant to be changed after the application has built, then I would store the JSON file in your project outside of any Resources folder. I think this file will be automatically interpreted as a TextAsset asset you can edit using functions from the System.IO namespace.


Check here for more info http://answers.unity.com/answers/1170581/view.html (2nd answer)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Pharez · Mar 13, 2020 at 10:38 AM

A general rule of thumb when coding is that if you are using a well maintained and professional code like Unity's it will probably work just fine, it's implementing your own solutions to already well solved problems that you should be weary of. Though I am not saying don't solve things yourself just that it is more likely to go wrong than using a good library. So yes, this is fine and in fact if you take a look at the docs, they already have the pattern for loading a JSON file using Resources.Load. Memory is almost never an issue when doing anything on modern computers, as long as your file size doesn't somehow get to gigabytes in size it should be fine. If it does then you will have to do some stuff to manually convert it to an object a little bit at a time probably, but it might just work anyway. I recently used Resources.Load for one of my tools and it worked 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 faryar76_unity · Mar 13, 2020 at 01:15 PM 0
Share

thanks. what should i do for load prefabs? move all prefabs to Resoureces? make a class and drag all prefabs as list items to that?

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

126 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 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

Rendering Image Sprites Programatically 0 Answers

Level Editors? 1 Answer

Level managers and editor 0 Answers

Saving a level with the help of prefabs 3 Answers

How should I make this type of text level editor? C# 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