I
I
Ivan Ivanov2021-09-20 19:02:29
Unity
Ivan Ivanov, 2021-09-20 19:02:29

How to create a resource in unity3d (Resources.Save())?

The unit can load resources: Resources.Load<type>(path), but I need to create a resource in the game and save it (like Resources.Save<type>(path) ) - but it doesn't. For example, I create a texture in the game and I want to save it so that I can read it later

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NoNameDeveloper, 2021-09-22
@NoNameDeveloper

At runtime, you can't save files to resources. You can save to temporaryCache, persistentDataPath and load from there.
You need to use the System.IO library and these 2 methods File.WriteAllBytes, File.ReadAllBytes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question