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 /
  • Help Room /
avatar image
0
Question by Andrew.Duchini · Jan 03, 2016 at 05:37 PM · refresh

How to refresh a TXT file of my project

Im developing an App fo android and I need to save and load files using TXT. But after I save the files in the TXT I have an option to read all the files, but some of then are not being refreshed. So I tried to look for a solution to this problem and I found a question here that is almost the same thing, but the question was made in 2013 and I don't know if the sintaxe is the same. I read about something called Asset.DataBase.Refresh, its seeing to be exactly what I need, but I tried and mono said that Asset.DataBase.Refresh doesn`t exist. I`m using unity 5.0.1 and I tried to read at the unity`s manual and the example there was not clear for me and I couldn`t find a solution to my problem.

So I`m saving everything in Resources folder, and to load the TXT files I using Resource.Load and I stored the files in TextAssests. Everything is going OK, and after saving the files I have the option to read all the files, but some of the are old, and wasn`t updated, if I go to the apps folder and look for the new TXT it`s up to date, and if I go back to the App and select the option to read files again, the app write everything OK with the files up to date. So I need Unity to refresh the files to write the newer TXT files.

Hope you guys can help me!

Thanks!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by vintar · Jan 03, 2016 at 09:12 PM

the method is AssetDatabase.Refresh . Check here http://docs.unity3d.com/ScriptReference/AssetDatabase.Refresh.html

Comment
Add comment · Show 2 · 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 Andrew.Duchini · Jan 03, 2016 at 09:47 PM 0
Share

but how does it work? Can you give me a piece of code just to understand how it works? $$anonymous$$y doubt is how the syntaxe is.

thanks for the quickly reply!

avatar image vintar Andrew.Duchini · Jan 03, 2016 at 09:54 PM 0
Share

$$anonymous$$aybe this shows it better : http://docs.unity3d.com/$$anonymous$$anual/AssetDatabase.html

avatar image
0

Answer by ClementHo · Jul 21, 2016 at 07:24 AM

i hope this helps: you need to type "using UnityEditor;" at the top of the c# script. and then call " AssetDatabase.Refresh(); " wherever u need.

i was also trying to figure it out.

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 Amirjaouani · Jan 19, 2018 at 08:25 AM 0
Share

But, if i want refresh on moblie device. There is somthing like UnityEditor but for smartphone?

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

40 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

Related Questions

Can anyone tell me what the issue is with my code? (C#) 1 Answer

TextMeshPro Dropdown RefreshValue not working 0 Answers

How to refresh/reload all C# scripts in project? 1 Answer

Editor Ram Usage Skyrockets upon refresh, decreases later on 0 Answers

Can I RenderSettings script are refresh setting by Reloaded Scene? 0 Answers


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