Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 emrexconi · Oct 14, 2020 at 10:03 PM · build-errorassetbundleresourcesresources.loadassetdatabase

how to load texture from C:\ Folder at Runtime build

i use images fot the texture of the material. the images downloading from web page to Resources folder. and it works at runtime mode.

when i build windows exe, i didn't get error message at console.

if i click exe file and open game. it doesnt load the textures. how to load any images,obj models from any folder of hard drive.

Code:

   private void ModelGetir()
 {
     Thread.Sleep(3000);
     loadedObj = new OBJLoader().Load("Assets/Resources/Data/Models/" + ModelID + "/Model.obj");

     Texture2D textureMain = Resources.Load("Data/Models/" + ModelID + "/Model", typeof(Texture2D)) as Texture2D;
     Texture2D textureNormal = Resources.Load("Data/Models/" + ModelID + "/Model_normal", typeof(Texture2D)) as Texture2D;

     mat = Resources.Load("SkinMat/Mat", typeof(Material)) as Material;
     mat.SetTexture("_BaseColorMap", textureMain);
     mat.SetTexture("_NormalMap", textureNormal);
     //    //-----------------------------------------------------
     //    matClay = Resources.Load("clay", typeof(Material)) as Material;
     //    matClay.SetTexture("_BumpMap", textureNormal);

     loadedObj.transform.Find("default").GetComponent<Renderer>().material = mat;

     loadedObj.layer = 9;
     loadedObj.transform.Find("default").gameObject.layer = 9;
     loadedObjClone = Instantiate(loadedObj);
     loadedObjClone.layer = 10;
     loadedObjClone.transform.Find("default").gameObject.layer = 10;

     GameObject Head_mesh = loadedObj.transform.Find("default").gameObject;
     if (Head_mesh)
     {
         Head_mesh.AddComponent<MeshCollider>();
         Head_mesh.AddComponent<Make_Mesh_Sutable_for_Sculpturing>();
         Head_mesh.tag = "Editable";
         Debug.Log("Scupting Brush yuklendi");
     }

     loadingmesaj = "...";
     loadingYon = "down";
     SetloadedObj = true;
 }
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 muckenhoupt · Oct 15, 2020 at 01:03 AM

I suggest downloading the images to the StreamingAssets folder instead. (Use Application.streamingAssetsPath at runtime to get its location. Standalone builds have it in a different place than the Unity editor.)

I don't know if that will fix your problem, but it's worth a try. Standalone executables definitely know how to read resources from individual files when they're under StreamingAssets.

Comment
Add comment · 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
0

Answer by emrexconi · Oct 15, 2020 at 06:41 AM

thank you so much muckenhoupt i'll let you know when i try this.

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 emrexconi · Oct 15, 2020 at 09:01 AM 0
Share

i have tested and it didnt work.

unity didnt see the path, what is the alternative solition for this

thank you in advance

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

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

How to do something similar to AssetDatabase.Refresh during build? 0 Answers

What use instead of Resources folder? 3 Answers

Instantiating without the use of Resource Folder in Unity? 0 Answers

Resources.Load() doesn't work unless load path is hard coded. 1 Answer

How to get Resource path of asset/prefab in code? 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