• 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 Krlos92 · Jun 14, 2015 at 07:20 AM · runtimetexturesloadmanager

How to change Textures after build the game?

Hello,

The idea is this . The game brings a default textures , but I want the user be able to change them if he/she wants. I dont know if it is possible to do this , and if so , how do I do?

I have two things in mind:

  1. The user adds textures in a specific folder , using specific names and sizes , so that after, the game detect and load the textures.

  2. Using an interface that allows the user to find, select and load the textures by object...

What do you recommend me ?

How do I load the textures ?

And if there is a better way, please tell me

Thank you very much.

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
1

Answer by Hellium · Jun 22, 2015 at 07:19 PM

The solutions are both possible, but implementing the second one is much more difficult than the first (no GUI, no scripting, etc)

If you really want the second solution, you will have to make a file browser (some are free over the web). For a custom one see the .NET File and Directory classes :

https://msdn.microsoft.com/en-us/library/system.io.file(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.io.directory(v=vs.110).aspx

Then, you could simply copy the selected file by the user with the appropriate .NET function :

https://msdn.microsoft.com/en-us/library/system.io.file.copy(v=vs.110).aspx

You won't have to "load" a texture, but simply copy it in the appropriate folder (inside the Resources folder : http://docs.unity3d.com/ScriptReference/Resources.html) with the appropriate name.

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 Cherno · Jun 22, 2015 at 07:33 PM 0
Share

You might want to set the Filter$$anonymous$$ode etc. too.

avatar image
0

Answer by TheXWolf · Jun 22, 2015 at 07:39 PM

I think #1 is a better solution, saves you from having to create different UI components in the game. Simply load and atlas textures when the game boots by checking a folder for files by name. If the file matches a name for each file, then it simply replaces it. There's a number of basic methods for doing that so I won't go into them; I would simply say the first one is the better option.

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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

C# Error when trying to load Texture at runtime 1 Answer

Need to load prefabs during runtime 1 Answer

loading object @ runtime in webplayer.... 4 Answers

Grab Image/texture from MTL file and apply to a game object 1 Answer

Why are my textures black at runtime? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges