UNITY3D 中的图片库
是否可以创建类似于 this< 的图片库/a> 使用 Unity3d。我知道可以使用 jQuery 单击、拖动图像并保存它们。但是有没有办法在Unity3d中动态创建图像,然后加载、移动、拖动和保存它们呢?
如果这听起来令人困惑,这就是我想做的。
创建一个空白板。 将“n”个图像添加到板上以将它们显示在屏幕上。 添加新图像时,其他图像会自动移动和调整以适应新图像(自动对齐功能)。 图像可能不是固定大小的。 最后,完成所有这些后,保存页面,以便下次它们都以相同的方式加载。 所有这些都需要使用网络播放器来完成。(应该首先提到这一点)。 到目前为止我的想法是——
为棋盘创建一个平面。 (这将保存图像)。 创建/加载飞机的预制件,然后将图像作为纹理添加到其中。所以这将为 n 个图像创建“n”个不同的平面。 用户完成排列平面后,保存平面的 rect() 属性。 使用Unity3d可以做到这一点还是有更好的解决方案?我需要创建一个照片库,用户基本上可以进入工作室并看到工作室每一面的不同照片。
非常感谢任何建议和帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Unity 网络播放器中,作为一种安全机制,不可能将文件保存到硬盘上。
然而,其余的很有可能......我可能有办法
使用 WWW 类您可以下载图像,然后将它们用作纹理..并将它们放置在平面上。
使图库可导航需要一些代码,应该非常简单。
最后,保存图像(解决方法版本):您可以利用浏览器 cookie,并让这些 cookie 的到期日期变得荒谬。这样您就可以保存用户已保存的所有图像的链接。我要做的是将它们存储为以下内容:
以数字方式保存cookie..例如。 Pic1,Pic2,Pic3..然后当你的程序打开时,它可以使用循环来获取这些图片,直到找不到cookie为止(在示例中,它会在查找Pic4时停止)另一个选择是存储图片数量在另一个cookie中。
希望这有帮助,祝你好运!
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!