Rotating faces Rubik's Cube C#

♀尐吖头ヾ 提交于 2019-12-04 13:20:40

My idea: Keep each of the 26 blocks as separate GameObject objects (8 corners, 12 edges, 6 centers), with each block's origin in the center of the cube. Separately you keep track of which block is currently where on the cube, for example in a 3D array.

Then when a face needs to be turned:

  • Find out which blocks belong to the face.
  • Rotate each of those blocks around the axis of rotation (through the middle of the cube) using Unity's normal rotation functionality.
  • Update the information on which blocks are where.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!