public override ProBuilderMesh Build(bool preview = false) { return(ShapeGenerator.GenerateArch( EditorUtility.newShapePivotLocation, s_Angle, s_Radius, Mathf.Clamp(s_Width, 0.01f, s_Radius), s_Depth, s_RadiusSegments + 1, k_InsideFaces, k_OutsideFaces, k_FrontFaces, k_BackFaces, s_EndCaps)); }
/// <summary> /// 创建圆环 /// </summary> /// <param name="deg">圆环角度</param> /// <param name="radius">圆环半径</param> /// <param name="dot">圆环初始位置角度</param> private void CreateArch(int deg, int radius, int dot) { ProBuilderMesh pbMesh = ShapeGenerator.GenerateArch(PivotLocation.FirstVertex, deg, radius, 1, 1, 20, true, true, true, true, true); pbMesh.gameObject.tag = "Archs"; pbMesh.gameObject.AddComponent <MeshCollider>(); pbMesh.transform.Rotate(-90, 0, 0); pbMesh.GetComponent <MeshRenderer>().material = data.mat; Transform yPos = new GameObject("yPos").transform; yPos.Rotate(0, dot, 0); pbMesh.transform.SetParent(yPos, false); yPos.SetParent(this.transform, false); archs.Add(pbMesh); }