本文整理汇总了C#中VectorLine.MakeText方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLine.MakeText方法的具体用法?C# VectorLine.MakeText怎么用?C# VectorLine.MakeText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorLine
的用法示例。
在下文中一共展示了VectorLine.MakeText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start ()
{
index = mainCounter;
mainCounter++;
List<Vector3> ptsXY = new List<Vector3> ();
List<Vector3> ptsXZ = new List<Vector3> ();
List<Vector3> ptsYZ = new List<Vector3> ();
//GRID XY
if (displayGridXY) {
for (int i = 1; i < gridNSteps; i++) {
ptsXY.Add (new Vector3 (0, i * gridDelta, 0));
ptsXY.Add (new Vector3 ((gridNSteps + 1) * gridDelta, i * gridDelta, 0));
ptsXY.Add (new Vector3 (i * gridDelta, 0, 0));
ptsXY.Add (new Vector3 (i * gridDelta, (gridNSteps + 1) * gridDelta, 0));
}
gridXY = new VectorLine ("gridXY", ptsXY, textureGridXY, gridThickness);
}
if (displayGridXZ) {
//GRID XZ
for (int i = 1; i < gridNSteps; i++) {
ptsXZ.Add (new Vector3 (i * gridDelta, 0, 0));
ptsXZ.Add (new Vector3 (i * gridDelta, 0, (gridNSteps + 1) * gridDelta));
ptsXZ.Add (new Vector3 (0, 0, i * gridDelta));
ptsXZ.Add (new Vector3 ((gridNSteps + 1) * gridDelta, 0, i * gridDelta));
}
gridXZ = new VectorLine ("gridXZ", ptsXZ, textureGridXZ, gridThickness);
}
if (displayGridYZ) {
//GRID YZ
for (int i = 1; i < gridNSteps; i++) {
ptsYZ.Add (new Vector3 (0, i * gridDelta, 0));
ptsYZ.Add (new Vector3 (0, i * gridDelta, (gridNSteps + 1) * gridDelta));
ptsYZ.Add (new Vector3 (0, 0, i * gridDelta));
ptsYZ.Add (new Vector3 (0, (gridNSteps + 1) * gridDelta, i * gridDelta));
}
gridYZ = new VectorLine ("gridYZ", ptsYZ, textureGridYZ, gridThickness);
}
axisX = new VectorLine ("axisX", new List<Vector3> () {
new Vector3 (0, 0, 0),
new Vector3 (axisLength, 0, 0)
}, textureAxisX, axisThickness);
axisY = new VectorLine ("axisY", new List<Vector3> (){
new Vector3 (0, 0, 0),
new Vector3 (0, axisLength, 0)
}, textureAxisY, axisThickness);
axisZ = new VectorLine ("axisZ", new List<Vector3> () {
new Vector3 (0, 0, 0),
new Vector3 (0, 0, axisLength)
}, textureAxisZ, axisThickness);
if (displayNegativeAxis) {
axisNegX = new VectorLine ("axisNegX", new List<Vector3> (){
new Vector3 (0, 0, 0),
new Vector3 (-axisLength, 0, 0)
}, textureAxisNegX, axisThickness);
axisNegY = new VectorLine ("axisNegY", new List<Vector3> () {
new Vector3 (0, 0, 0),
new Vector3 (0, -axisLength, 0)
}, textureAxisNegY, axisThickness);
axisNegZ = new VectorLine ("axisNegZ", new List<Vector3> () {
new Vector3 (0, 0, 0),
new Vector3 (0, 0, -axisLength)
}, textureAxisNegZ, axisThickness);
}
if (displayXYZ) {
letterX = new VectorLine ("letterX", new List<Vector3> () {
new Vector3 (0, 0, 0),
new Vector3 (axisLength, 0, 0)
}, textureAxisX, 1f);
letterX.MakeText ("X", new Vector3 (axisLength + .5f, .5f, 0), 1);
letterY = new VectorLine ("letterY", new List<Vector3> () {
new Vector3 (0, 0, 0),
new Vector3 (axisLength, 0, 0)
}, textureAxisY, 1f);
letterY.MakeText ("Y", new Vector3 (-.25f, axisLength + 1.5f, 0), 1);
letterZ = new VectorLine ("letterZ", new List<Vector3> (){
new Vector3 (0, 0, 0),
new Vector3 (axisLength, 0, 0)
}, textureAxisZ, 1f);
letterZ.MakeText ("Z", new Vector3 (0, .5f, axisLength + .5f), 1);
}
if (displaySphericalEnds) {
sphericalEnds = new List<Transform> ();
//on s'occupe de l'axe Ox
sphericalEnds.Add (CreateSphere (Color.red, Vector3.right * axisLength, .5f).transform);
if (traceXEndPos) {
GameObject tracerGO = Instantiate (tracers [0]) as GameObject;
tracerGO.transform.parent = sphericalEnds [sphericalEnds.Count - 1];
tracerGO.transform.localPosition = Vector3.zero;
//.........这里部分代码省略.........
示例2: Update
// Update is called once per frame
void Update()
{
if (showDrawingTools) {
mousePos = transform.InverseTransformPoint (Input.mousePosition);
if (mousePos.y < Screen.height - minH && mousePos.y > minH && mousePos.x > minW && mousePos.x < Screen.width - minW)
inside = true;
else
inside = false;
if (CizimBasladi == true && refX < mousePos.x && inside == true) {
if (!(Input.GetKey (KeyCode.LeftShift) || Input.GetKey (KeyCode.RightShift)))//false ise
refY = mousePos.y;//sonrada ivmeyi değiştirebilmek için
if ((Input.GetKey (KeyCode.LeftShift) || Input.GetKey (KeyCode.RightShift))) {
gecici.points2 = new Vector2[4] {
new Vector2 (refX, refYx),
new Vector2 (refX, refY),
new Vector2 (refX, refY),
new Vector2 (mousePos.x, refY)
};
} else if (index > 0)//ilk line çizildimi? ilk line da y'de çizgi yok.
gecici.points2 = new Vector2[4] {
new Vector2 (refX, refYx),
new Vector2 (refX, mousePos.y),
new Vector2 (refX, refY),
new Vector2 (mousePos.x, refY)
};
else
gecici.points2 = new Vector2[4] {
new Vector2 (mousePos.x, mousePos.y),
new Vector2 (mousePos.x, mousePos.y),
new Vector2 (refX, refY),
new Vector2 (mousePos.x, refY)
};
gecici.Draw ();
VectorLine.Destroy (ref textVec);
textVec = new VectorLine ("Text" + (index), new Vector2[2]{new Vector2 (refX, refY - 5),new Vector2 (refX + 15, refY + 15)}, Color.black, null, 2f, LineType.Discrete, Joins.Weld);
if (refY > Screen.height / 2)
textVec.MakeText ("(t=" + (mousePos.x - minW) / snToPixel + ",a=" + (refY - minH - maxH / 2) / snToPixel + ")", new Vector2 (mousePos.x, mousePos.y + 25), 10f);
else
textVec.MakeText ("(t=" + (mousePos.x - minW) / snToPixel + ",a=" + (maxH / 2 - (refY - minH)) / snToPixel * -1 + ")", new Vector2 (mousePos.x, mousePos.y + 25), 10f);
textVec.Draw ();
guideY.points2 = new Vector2[2]{new Vector2 (mousePos.x, minH),new Vector2 (mousePos.x, maxH + minH)};
guideY.Draw ();
CizimBitti = true;
}
if (Input.GetMouseButtonDown (0) && finish == false && inside == true) {
instantiated = true;
CizimBasladi = true;
refY = mousePos.y;
}
if (Input.GetMouseButtonUp (0) && finish == false && inside == true) {
dotPoints [numberOfDots] = new Vector2 (refX, refY);//önce ilk değeri index olarak kullanıp sonra arttırır (ex ++i)
dots.maxDrawIndex = numberOfDots;
numberOfDots++;
dots.drawTransform = transform;
dots.Draw ();
/*
textVectors[numberOfDots-1]= new VectorLine("Text"+(numberOfDots-1),new Vector2[2]{new Vector2(refX,refY-5),new Vector2(refX+15,refY+15)},Color.black,null,2f,LineType.Discrete,Joins.Weld);
textVectors[numberOfDots-1].MakeText("("+refX/snToPixel+","+refY/snToPixel+")",new Vector2(refX,refY+25),10f);
textVectors[numberOfDots-1].Draw();
*/
/*point yazdırma
textVector=new VectorLine("Text",new Vector2(refX,refY),null,5f);
textVector.MakeText ("sdfgdfad",new Vector2(refX,refY),30f);
*/
refYx = mousePos.y;
gecici.points2 = new Vector2[4] {
new Vector2 (minW, minH),
new Vector2 (minW, minH),
new Vector2 (minW, minH),
new Vector2 (minW, minH)
};
gecici.Draw ();
linePoints [2 * index] = new Vector2 (refX, refY);
if (refX < mousePos.x) {
refX = mousePos.x;
} else {
refX += snToPixel;
}
linePoints [2 * index + 1] = new Vector2 (refX, refY);
//.........这里部分代码省略.........
示例3: OnGUI
//.........这里部分代码省略.........
for (int i =0; i<=maxW/snToPixel*2; i+=2) {
linePointsX[i].x=minW+i*snToPixel/2;
linePointsX[i].y=(Screen.height/2)-5;
linePointsX[i+1].x=minW+i*snToPixel/2;
linePointsX[i+1].y=(Screen.height/2)+5;
}
//snToPixel en az 5 olabilir ise.
linePointsY=new Vector2[(maxH/5)*4];
for (int i =0; i<=maxH / snToPixel * 2+2; i+=2) {
linePointsY[i].x=minW-5;
linePointsY[i].y=minH+i*snToPixel/2;
linePointsY[i+1].x=minW+5;
linePointsY[i+1].y=minH+i*snToPixel/2;
}
//Numara yazımı
for (int i =0; i<(maxH/5)*2; i+=2) {
VectorLine.Destroy(ref linePointsYNmb[i/2]);
}
for (int i =0; i<=maxH / snToPixel*2+2; i+=2) {
linePointsYNmb[i/2]=new VectorLine("Numb"+i/2,new Vector2[2]{new Vector2(minW-15,minH+i*snToPixel/2),new Vector2(minW,minH+i*snToPixel/2)},null,2f,LineType.Discrete,Joins.Weld);
if(i/2*snToPixel>maxH/2)
linePointsYNmb[i/2].MakeText(""+(i/2*snToPixel-maxH/2)/snToPixel,new Vector2(minW-15,minH+i*snToPixel/2),10f);
else
linePointsYNmb[i/2].MakeText(""+(maxH/2-(i/2-1)*snToPixel)/snToPixel*-1 ,new Vector2(minW-25,minH+i*snToPixel/2),10f);
linePointsYNmb[i/2].Draw();
}
VectorLine.Destroy (ref textVec);
textVec=new VectorLine("Text"+(index),new Vector2[2]{new Vector2(refX,refY-5),new Vector2(refX+15,refY+15)},Color.black,null,2f,LineType.Discrete,Joins.Weld);
if(refY>Screen.height/2)
textVec.MakeText("(t="+(mousePos.x-minW)/snToPixel+",a="+(mousePos.y-minH-maxH/2)/snToPixel+")",new Vector2(mousePos.x,mousePos.y+25),10f);
else
textVec.MakeText("(t="+(mousePos.x-minW)/snToPixel+",a="+(maxH/2-(mousePos.y-minH))/snToPixel*-1+")",new Vector2(mousePos.x,mousePos.y+25),10f);
refY = minH;
refX = minW;
time = minW;
index = 0;
oldWidth = Screen.width;
SetLine();
finish = false;
CizimBasladi = false;
CizimBitti = false;
instantiated = false;
inside = false;
gecici = new VectorLine("gecici", new Vector2[4]{new Vector2(minW,minH),new Vector2(minW,minH),new Vector2(minW,minH),new Vector2(minW,minH)}, Color.white, null, 2f, LineType.Discrete);
gecici.Draw();
guideY = new VectorLine ("guideY",new Vector2[2]{new Vector2(time,minH),new Vector2(time,maxH+minH)},Color.red,null,2f,LineType.Discrete);
guideY.Draw ();
示例4: Start
// Use this for initialization
void Start()
{
refY = minH;
refX = minW;
time = minW;
index = 0;
oldWidth = Screen.width;
finish = false;
CizimBasladi = false;
CizimBitti = false;
instantiated = false;
inside = false;
textVectors=new VectorLine[50];
for (int i=0; i<50; i++) {
textVectors[i]=new VectorLine("Text"+i,new Vector2[2]{new Vector2(0,0),new Vector2(0,0)},null,2f,LineType.Discrete,Joins.Weld);
}
textVec=new VectorLine("GuideText",new Vector2[2]{new Vector2(0,0),new Vector2(0,0)},null,2f,LineType.Discrete,Joins.Weld);
maxH = Screen.height - 2 * minH;
maxW = Screen.width - 2 * minW;
linePoints= new Vector2[100];
for (int i=0; i<100; i++) {
linePoints[i]=Vector2.zero;
}
atGraphAfterVtPoints = new Vector2[100];
for(int i=0;i<100;i++){
atGraphAfterVtPoints[i]=Vector2.zero;
}
canerinArray = new Vector2[49];
for (int i=0; i<49; i++) {
canerinArray[i]=Vector2.zero;
}
VelocityArray=new Vector2[50];
for (int i=0; i<49; i++) {
VelocityArray[i]=Vector2.zero;
}
dotPoints = new Vector2[50];
for(int i=0;i<50;i++){
dotPoints[i]=Vector2.zero;
}
numberOfDots = 0;
dots = new VectorPoints ("Dots", dotPoints, Color.red, null, 10f);
dots.maxDrawIndex = numberOfDots;
linePointsX=new Vector2[(maxW/snToPixel)*4];
for (int i =0; i<=maxW/snToPixel*2; i+=2) {
linePointsX[i].x=minW+i*snToPixel/2;
linePointsX[i].y=(Screen.height/2)-5;
linePointsX[i+1].x=minW+i*snToPixel/2;
linePointsX[i+1].y=(Screen.height/2)+5;
}
//snToPixel en az 5 olabilir ise.
linePointsY=new Vector2[(maxH/5)*4];
for (int i =0; i<=maxH / snToPixel * 2+2; i+=2) {
linePointsY[i].x=minW-5;
linePointsY[i].y=minH+i*snToPixel/2;
linePointsY[i+1].x=minW+5;
linePointsY[i+1].y=minH+i*snToPixel/2;
}
//Numara yazımı
linePointsYNmb=new VectorLine[(maxH/5)*2];
for (int i =0; i<=maxH / snToPixel*2+2; i+=2) {
linePointsYNmb[i/2]=new VectorLine("Numb"+i/2,new Vector2[2]{new Vector2(minW-15,minH+i*snToPixel/2),new Vector2(minW,minH+i*snToPixel/2)},null,2f,LineType.Discrete,Joins.Weld);
if(i/2*snToPixel>maxH/2)
linePointsYNmb[i/2].MakeText(""+(i/2*snToPixel-maxH/2)/snToPixel,new Vector2(minW-15,minH+i*snToPixel/2),10f);
else
linePointsYNmb[i/2].MakeText(""+(maxH/2-(i/2-1)*snToPixel)/snToPixel*-1 ,new Vector2(minW-25,minH+i*snToPixel/2),10f);
linePointsYNmb[i/2].Draw();
}
VectorLine.Destroy (ref textVec);
textVec=new VectorLine("Text"+(index),new Vector2[2]{new Vector2(refX,refY-5),new Vector2(refX+15,refY+15)},Color.black,null,2f,LineType.Discrete,Joins.Weld);
if(refY>Screen.height/2)
textVec.MakeText("(t="+(mousePos.x-minW)/snToPixel+",a="+(mousePos.y-minH-maxH/2)/snToPixel+")",new Vector2(mousePos.x,mousePos.y+25),10f);
else
textVec.MakeText("(t="+(mousePos.x-minW)/snToPixel+",a="+(maxH/2-(mousePos.y-minH))/snToPixel*-1+")",new Vector2(mousePos.x,mousePos.y+25),10f);
textVec.Draw();
gecici = new VectorLine("gecici", new Vector2[4]{new Vector2(minW,minH),new Vector2(minW,minH),new Vector2(minW,minH),new Vector2(minW,minH)}, Color.white, null, 2f, LineType.Discrete);
gecici.Draw();
guideY = new VectorLine ("guideY",new Vector2[2]{new Vector2(time,minH),new Vector2(time,maxH+minH)},Color.red,null,2f,LineType.Discrete);
guideY.Draw ();
//.........这里部分代码省略.........