Loading a texture from an external resource

Hey there Unity users. I want to start learning Unity for a project I’ve had in mind for quite a while. Now I am wondering one thing before I want to make the effort of diving into Unity and its scripting.

I was wondering whether I can use Unity to

  1. save something from unity to a bitmap, and
  2. to reload it from the filesystem or dbase (via PHP for instance) at runtime (ie: no caching occurs) on my model

I did some searching on the forums, and I found some stuff using System.IO, but it wasn’t fully answering my question :slight_smile:

Thanks in advance :slight_smile:

You can indeed.

  1. You can use Texture2D.EncodeToPNG to save the image, and

  2. the WWW class to grab the file. If you’re sneaky, you can even use file:// to grab a local file in the folder structure (works in editor playmode, anyway).

that’s all I needed to know :slight_smile:
thanks a whole bunch LoTekK! diving into Unity as we speak :slight_smile: