简体   繁体   English

Unity应用程序中的独立元素

[英]Independent elements in Unity application

Hello I would like to create an android application where the cube will be rotated and user can select any numer of cube walls. 您好,我想创建一个Android应用程序,将旋转多维数据集,并且用户可以选择任意数量的多维数据集墙。 I want to use the Unity 3d to application and Blender program to create the cube. 我想使用Unity 3d应用程序和Blender程序来创建多维数据集。 I don't know how to make independent sides of the cube. 我不知道如何制作立方体的独立面。

I mean… For example We have a dice and the walls are numbered from 1 to 6. As a user for example, I want to mark walls 2 and 4. And I also want walls 2 and 4 to turn orange when pressed on the phone. 我的意思是…例如,我们有一个骰子,墙壁的编号从1到6。例如,作为一个用户,我想标记墙壁2和4。并且我还希望墙壁2和4在按下电话时变成橙色。 。

And my problem is that I don't know what to do to make this walls independent of the entire body. 我的问题是我不知道该怎么做才能使这堵墙独立于整个身体。 So that when you press any side of the cube, only this side will change the color, not the whole cube. 这样,当您按下立方体的任何一侧时,只有这一侧会改变颜色,而不是整个立方体。

Edit: Sorry for my English. 编辑:对不起,我的英语。 Maybe I can show my problem in a picture enter image description here 也许我可以在图片中显示我的问题在这里输入图片描述

If you really need to use cube, you can write a custom shader that will change only one wall at a time. 如果确实需要使用多维数据集,则可以编写一个自定义着色器,该着色器一次只能更改一堵墙。

You can also use 6 quads that you child to a single object and rotate so the result looks like a cube. 您还可以将子对象的6个四边形用于单个对象并旋转,以使结果看起来像一个立方体。 Now you have 6 individual objects and you can detect clicks on each separately. 现在,您有6个单独的对象,您可以分别检测每个对象的点击。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM