本文整理汇总了C#中VectorLine.Draw3D方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLine.Draw3D方法的具体用法?C# VectorLine.Draw3D怎么用?C# VectorLine.Draw3D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorLine
的用法示例。
在下文中一共展示了VectorLine.Draw3D方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
GridSize = GlobalVars.GridSize;
VectorLine.SetCamera3D(GameObject.Find(VectrosityCamera));
LinePoints = new List<Vector3>();
// Init Stuff
//CreateGridLines();
// Creating array of lines
var myLine = new VectorLine(LineName, LinePoints, null, LineWidth);
myLine.SetColor(Color.white);
// Setting up the line
myLine.Draw3D();
GameObject.Find(LineName).transform.position = new Vector3(0.5f, GridHeight, 0.5f);
// Position Camera with the Grid
CreateClickableTile();
}// Start
示例2: Start
void Start()
{
_vector = new VectorLine("beatcircle", new Vector3[10], Color.white, null, 1F, LineType.Continuous);
_vector.MakeCircle(Vector3.zero, 0.01F);
_vector.Draw3D();
_vector.vectorObject.transform.parent = transform;
gameObject.AddComponent<Scale>();
}
示例3: DrawWall
void DrawWall(Vector2[] room)
{
bool isClose = false;
if(room[0] == room[room.Length-1]){
isClose = true;
}
if(isClose){
List<Vector2> outter;
RoomQuad.GetPoint(room, true, out outter);
List<Vector2> inner;
RoomQuad.GetPoint(room, false, out inner);
WallFill wallFill = new WallFill(VectorLine.canvas3D, "wallFill");
wallFill.Add(outter, inner);
wallFill.Draw();
if(inner.Count > 0){
VectorLine roomInner = new VectorLine("RoomInner", inner, null, 1.0f, LineType.Continuous, Joins.Weld);
roomInner.SetColor(Color.black);
roomInner.Draw3D();
}
if(outter.Count > 0){
VectorLine roomOutter = new VectorLine("RoomOutter", outter, null, 1.0f, LineType.Continuous, Joins.Weld);
roomOutter.SetColor(Color.black);
roomOutter.Draw3D();
}
}
else {
Parallel parallel = new Parallel();
List<Vector2> outter = parallel.Execute(room, wallThick, false);
List<Vector2> inner = parallel.Execute(room, wallThick, true);
WallFill wallFill = new WallFill(VectorLine.canvas3D, "wallFill");
wallFill.Add(outter, inner);
wallFill.Draw();
// if(inner.Count > 0){
// VectorLine roomInner = new VectorLine("RoomInner", inner, null, 1.0f, LineType.Continuous, Joins.None);
// roomInner.SetColor(Color.black);
// roomInner.Draw3D();
// }
//
// if(outter.Count > 0){
// VectorLine roomOutter = new VectorLine("RoomOutter", outter, null, 1.0f, LineType.Continuous, Joins.None);
// roomOutter.SetColor(Color.black);
// roomOutter.Draw3D();
// }
// List<Vector3> outter;
// bool counterClockwise = RoomQuad.GetPoint(room, isClose, true, out outter);
//
// int length = outter.Count-1;
//
// int startA = -1;
// int startB = -1;
// int endC = -1;
// int endD = -1;
// for(int i=0; i < length; i++){
// Vector2 dist = outter[i] - room[0];
// float wallThick = (float)RoomQuad.WallThick;
// if(Mathf.Abs(dist.sqrMagnitude - wallThick/2*wallThick/2) < 0.001f){
// if(startA == -1){
// startA = i;
// }
// else{
// startB = i;
// }
// }
//
// dist = outter[i] - room[room.Length-1];
// if(Mathf.Abs(dist.sqrMagnitude - wallThick/2*wallThick/2) < 0.001f){
// if(endC == -1){
// endC = i;
// }
// else{
// endD = i;
// }
// }
// }
//
// Debug.Log(string.Format("start index: ({0}, {1}), ", startA, startB));
//
// Debug.Log("orientation: " + counterClockwise);
//
// List<Vector3> a = new List<Vector3>();
// List<Vector3> b = new List<Vector3>();
//
// if(counterClockwise){
//
// Vector3[] tmp = new Vector3[length+1];
// outter.CopyTo(0, tmp, 0, length);
//
//// if(length%2 == 1){
//// tmp[length] = tmp[length-1];
//// length++;
//// }
//
//.........这里部分代码省略.........
示例4: renderEdges
public void renderEdges()
{
riverarray = new List<VectorLine>();
foreach (var p in map.centers)
{
foreach (var r in p.neighbors)
{
var edge = map.lookupEdgeFromCenter(p, r);
Color32 colors;
float width = 1;
if (p.ocean != r.ocean)
{
// One side is ocean and the other side is land -- coastline
width = 1;
colors = displayColors["COAST"];
}
else if ((p.water) != (r.water) && p.biome != "ICE" && r.biome != "ICE")
{
// Lake boundary
width = 1;
colors = displayColors["LAKESHORE"];
}
else if (p.water || r.water)
{
continue; // Lake interior – we don't want to draw the rivers here
}
/*
// The fissures looked goofy, so I changed the full poly to lava and we'll ring them with scorch.
else if (lava.lava.ContainsKey(edge.index) && lava.lava[edge.index]) {
width = 1;
//GL.Color(displayColors["SCORCHED"]);
}
*/
else if (edge.river > 0)
{
// River edge
width = edge.river;
colors = displayColors["RIVER"];
}
else
{
continue; // No edge
}
var riverLine = new VectorLine("riverLine", new List<Vector3>() {
new Vector3(edge.v0.point.x,edge.v0.point.y,-1f),
new Vector3(edge.v1.point.x,edge.v1.point.y,-1f) },
width);
riverLine.SetColor(colors);
riverLine.Draw3D();
riverarray.Add(riverLine);
}
}
}
示例5: CreateVector
public static void CreateVector(LevelBase m, List<Vector2> vecs)
{
VectorLine vecline;
if (m.boundsVector != null)
{
DestroyImmediate(m.boundsVector);
}
vecs.Reverse();
//Vector2[] splinePoints = new Vector2[numberOfHills*2 + 1];
vecline = new VectorLine("Hills",
// new Vector2[m.numberOfPoints],
vecs.ToArray(),
m.hillMaterial, m.width, LineType.Continuous, Joins.Weld);
//vecline.useViewportCoords = true;
// hills.collider = true;
// vecline.MakeSpline( vecs.ToArray(), true ) ;
vecline.Draw3D();
m.boundsVector = vecline.vectorObject;
m.boundsVector.transform.parent = m.transform;
m.boundsVector.layer = 0;
GameObject vectorCam = GameObject.Find("VectorCam");
if (vectorCam != null)
DestroyImmediate(vectorCam);
}
示例6: SetGeoList
public void SetGeoList(Dictionary<string, List<Vector2>> list)
{
foreach (KeyValuePair<string, List<Vector2>> point in list)
{
List<Vector3> vertexes = new List<Vector3>();
List<Vector2> latlon = (List<Vector2>)point.Value;
for (int i = 0; i < latlon.Count; i = i + 5)
{
Vector3 xyzpoint = XYZfromLatLon(latlon[i].y, latlon[i].x);
vertexes.Add(xyzpoint);
}
VectorLine line = new VectorLine(point.Key, vertexes, lineMaterial.GetTexture(0), lineThickness, LineType.Continuous, Joins.Weld);
line.material = lineMaterial;
line.Draw3D();
lines.Add(line);
}
}
示例7: Circle
public Circle(Vector3 origin, float radius, Color theColor, int theWidth)
{
segments = Mathf.Max((int)radius, MAX_SEGMENTS);
vectorLine = new VectorLine("SelectCircle", new Vector3[segments * 2], theColor, null, theWidth);
vectorLine.MakeCircle(origin, Vector3.up, radius, segments);
prevPosition = origin;
circleColor = theColor;
this.radius = radius;
vectorLine.Draw3D();
}