开发者

Image gallery in UNITY3D

开发者 https://www.devze.com 2023-01-11 17:22 出处:网络
Is it possible to create an Image gallery similar to this using Unity3d. I know it is possible to click, drag images and save them using jQuery. But is there a way to create images dynamically in Unit

Is it possible to create an Image gallery similar to this using Unity3d. I know it is possible to click, drag images and save them using jQuery. But is there a way to create images dynamically in Unity3d and then load, move, drag and save them?

If that sounded confusing, this is what I want to do.

Create a blank board. Add 'n' number of images to the board to display them on the screen. As a new image is added the other images automatically move and adjust to accommodate the new image (auto align feature). The images may not be of fixed size. Finally once all this is done, save the page so that next time they are all loaded the same way. All this needs to be done using the Web Player.(should have mentioned this first). What I have thought so far-

Create a plane for the board. (this will hold the images). Create/load prefabs of planes and then add the images as texture to them. So this will create 'n' different planes for n images. Save the rect() property of the planes once the user is done arranging them. Is this possible using Unity3d or is there a better solution? I need to create a photo gallery where the user can basically enter the studio and see different photos of each side of the studio.

Any suggestions and help is much开发者_如何学运维 appreciated.


In Unity webplayer it is impossible to save files to the hard drive, as a safety mechanism.

The rest however, is very much possible.. and I might have a way to work around the "can't save on the hard drive thing"

Using the WWW class you can download images and then use them as textures.. and place them on planes.

Making the gallery navigable will require some code, should be pretty straight forward.

Finally, saving the images (Workaround edition): You could make use of browser cookies, and make the expiry date of these cookies ridiculous. This way you could save the links of all the images that the user has saved. What I would do is store them as the following:

Save cookies in a numerical way.. eg. Pic1, Pic2, Pic3.. Then when your program opens, it can use a loop to get these pictures, until a cookie is not found (In the example, it would stop when looking for Pic4) another option is storing the amount of pictures in another cookie.

Hope this helps, goodluck!

0

精彩评论

暂无评论...
验证码 换一张
取 消