0

In editor, the meta file records reference with other asset, so I think when build assetbundle, I need to include the .meta file also, so at runtime the asset will find the reference with each other.

But according to this link https://answers.unity.com/questions/910422/assetbundleloadmainassetatpath-not-loading-meta-fi.html , the answer said there is no need for it, I'm confused about that

1
  • No, you don't need to. ".meta" is an Editor extension. Commented Nov 4, 2018 at 11:56

2 Answers 2

2

From what I know, Unity uses these .meta files in the editor only. I'm pretty sure that the asset bundle contains data that tells it what files do what. The guy at the link you've posted seems to be pulling .meta files from the asset bundle and I don't think this is the correct way to do this, since you are basically doing it in the reverse of what unity was designed for. Try finding only the assets you are looking for, not the meta files. Also you should not have to manually include .meta files in your asset bundle, unity should do this automatically. And one last thing, Use unity's built in functions for accessing asset bundles rather than System.IO, since the system does not know what an asset bundle is, only unity does. Once the files are extracted onto your drive, then use System.IO on them.

Good luck.

Sign up to request clarification or add additional context in comments.

Comments

0

Unity's .meta files contain two important pieces of information:

  • The GUID that Unity uses to track any references to the Asset.
  • The settings for the Asset that you see in the Inspector window.

Hence, if you don't include them you risk breaking references and losing Asset settings.

This article on my blog explains meta files and GUIDs in more detail.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.