当前位置: 首页>>代码示例>>C#>>正文


C# Cube.rotateRightHoriz方法代码示例

本文整理汇总了C#中Cube.rotateRightHoriz方法的典型用法代码示例。如果您正苦于以下问题:C# Cube.rotateRightHoriz方法的具体用法?C# Cube.rotateRightHoriz怎么用?C# Cube.rotateRightHoriz使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cube的用法示例。


在下文中一共展示了Cube.rotateRightHoriz方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TriangulateCube

    void TriangulateCube(Cube square)
    {
        switch (square.configuration)
        {
        case 0:
            break;
        case 255:
            break;

        // 1 points:
        case 1:
            Instantiate (oneMesh, square.topLeftFront.position, Quaternion.Euler(new Vector3(0, 270, 180)));
            break;
        case 2:
            Instantiate (oneMesh, square.topLeftBack.position, Quaternion.Euler(new Vector3(0, 0, 0)));
            break;
        case 4:
            Instantiate (oneMesh, square.topRightFront.position, Quaternion.Euler(new Vector3(0, 90, 270)));
            break;
        case 8:
            Instantiate (oneMesh, square.topRightBack.position, Quaternion.Euler(new Vector3(0, 90, 0)));
            break;
        case 16:
            Instantiate (oneMesh, square.bottomRightFront.position, Quaternion.Euler(new Vector3(270, 90, 90)));
            break;
        case 32:
            Instantiate (oneMesh, square.bottomRightBack.position, Quaternion.Euler(new Vector3(0, 180, 0)));
            break;
        case 64:
            Instantiate (oneMesh, square.bottomLeftFront.position, Quaternion.Euler(new Vector3(270, 0, 270)));
            break;
        case 128:
            Instantiate (oneMesh, square.bottomLeftBack.position, Quaternion.Euler(new Vector3(0, 270, 0)));
            break;

        // 2 points
        case 3:
            Instantiate (threeMesh, square.topLeftFront.position, Quaternion.Euler(new Vector3(90, 270, 0)));
            break;
        case 5:
            Instantiate (threeMesh, square.topLeftFront.position, Quaternion.Euler(new Vector3(0, 90, 90)));
            break;
        case 10:
            Instantiate (threeMesh, square.topRightBack.position, Quaternion.Euler(new Vector3(0, 270, 270)));
            break;
        case 12:
            Instantiate (threeMesh, square.topRightBack.position, Quaternion.Euler(new Vector3(270, 0, 270)));
            break;
        case 20:
            Instantiate (threeMesh, square.bottomRightFront.position, Quaternion.Euler(new Vector3(0, 0, 0)));
            break;
        case 40:
            Instantiate (threeMesh, square.topRightBack.position, Quaternion.Euler(new Vector3(180, 0, 0)));
            break;
        case 48:
            Instantiate (threeMesh, square.bottomRightFront.position, Quaternion.Euler(new Vector3(90, 90, 0)));
            break;
        case 65:
            Instantiate (threeMesh, square.topLeftFront.position, Quaternion.Euler(new Vector3(0, 180, 0)));
            break;
        case 80:
            Instantiate (threeMesh, square.bottomRightFront.position, Quaternion.Euler(new Vector3(0, 270, 90)));
            break;
        case 130:
            Instantiate (threeMesh, square.bottomLeftBack.position, Quaternion.Euler(new Vector3(0, 0, 180)));
            break;
        case 160:
            Instantiate (threeMesh, square.bottomLeftBack.position, Quaternion.Euler(new Vector3(0, 90, 270)));
            break;
        case 192:
            Instantiate (threeMesh, square.bottomLeftBack.position, Quaternion.Euler(new Vector3(270, 90, 0)));
            break;

        case 9:
            Instantiate (nineMesh, square.topLeftFront.position, Quaternion.Euler(new Vector3(45, 180, 90)));
            break;
        case 6:
            square.rotateRightHoriz();
            MeshFromPoints(square.topLeftCenter, square.centerTopBack, square.topRightCenter, square.centerTopFront);
            MeshFromPoints(square.centerLeftFront, square.centerTopFront, square.topRightCenter, square.centerRightBack, square.centerTopBack, square.topLeftCenter);
            break;
        case 17:
            square.rotateRightHoriz();
            square.rotateRightVert();
            MeshFromPoints(square.topLeftCenter, square.centerTopBack, square.topRightCenter, square.centerTopFront);
            MeshFromPoints(square.centerLeftFront, square.centerTopFront, square.topRightCenter, square.centerRightBack, square.centerTopBack, square.topLeftCenter);
            break;
        case 24:
            square.rotateRightHoriz();
            square.rotateRightVert();
            square.rotateRightHoriz();
            square.rotateRightVert();
            MeshFromPoints(square.topLeftCenter, square.centerTopBack, square.topRightCenter, square.centerTopFront);
            MeshFromPoints(square.centerLeftFront, square.centerTopFront, square.topRightCenter, square.centerRightBack, square.centerTopBack, square.topLeftCenter);
            break;
        case 34:
            square.rotateRightHoriz();
            square.rotateRightHoriz();
            square.rotateRightVert();
            square.rotateRightHoriz();
//.........这里部分代码省略.........
开发者ID:Sean-Hastings,项目名称:CaveGame,代码行数:101,代码来源:MeshGeneratorThreeD.cs


注:本文中的Cube.rotateRightHoriz方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。