首页 > 解决方案 > 我遇到了错误 CS1513 的问题:} 预期

问题描述

for (int x = 0; x < resolution; x++)
{
    Vector2 percent = new Vector2(x, y) / (resolution - 1);
    Vector3 PointOnUnitCube = locallUp + (percent.x - .5f) * 2 * axisA + percent.x - .5f;) * 2 * axisB;
    vertices[i] = PointOnUnitCube;
    if (x != resolution - 1 && y != resolution - 1);
    {
        triangles[triIndex] = i;
        triangles[triIndex+1] = i+resolution + 1;
        triangles[triIndex+2] = i + resolution;
        triangles[triIndex+3] = i;
        triangles[triIndex+4] = i + 1;
        triangles[triIndex+5] = i + resolution + 1;
        triIndex += 6;
    }
}

我不知道该怎么做我以为我输入了正确的所有内容。
我在这里想念什么?我需要编辑一些东西吗?如果是这样,那么在哪里?

标签: c#unity3d

解决方案


In 5th line you haven't put (. and also remove additional ;s

Vector3 PointOnUnitCube = locallUp + ((percent.x-.5f)*2*axisA + percent.x-.5f)*2*axisB;
                                     ^
if (x! = resolution-1 && y! = resolution-1)

推荐阅读