本文整理汇总了C#中VectorLine.SetColor方法的典型用法代码示例。如果您正苦于以下问题:C# VectorLine.SetColor方法的具体用法?C# VectorLine.SetColor怎么用?C# VectorLine.SetColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VectorLine
的用法示例。
在下文中一共展示了VectorLine.SetColor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: AddGrid
void AddGrid()
{
float rowCount = 12.0f;
float colCount = 16.0f;
float colStep = Screen.width / colCount;
float rowStep = Screen.height / rowCount;
// Debug.Log (colStep + " " + rowStep);
// Debug.Log (Screen.width + " " + Screen.height);
//
// for (int i = 0; i < rowCount; i++) {
//
//
// Vector2 a = new Vector2 (0, i * rowStep);
//
// Vector2 b = new Vector2 (Screen.width, i * rowStep);
//
//
// Debug.DrawLine (a, b, Color.red);
//
// }
//
//
// for (int j = 0; j < 16; j++) {
//
// Vector2 a = new Vector2 (j * colStep, 0);
// Vector2 b = new Vector2 (j * colStep, Screen.height);
//
// Debug.DrawLine (a, b, Color.red);
// }
for (int i = 0; i < rowCount; i++) {
Vector2 a = new Vector2 (0, i * rowStep);
Vector2 b = new Vector2 (Screen.width, i * rowStep);
VectorLine line = new VectorLine ("row" + i, new Vector2[]{a,b}, null, 1.0f);
line.SetColor (Color.green);
line.Draw ();
}
for (int j = 0; j < 16; j++) {
Vector2 a = new Vector2 (j * colStep, 0);
Vector2 b = new Vector2 (j * colStep, Screen.height);
VectorLine line = new VectorLine ("col" + j, new Vector2[]{a,b}, null, 1.0f);
line.SetColor (Color.green);
line.Draw ();
}
}
示例3: CreateRect
/// <summary>
/// 绘制矩形
/// </summary>
private void CreateRect(float posX, float posY, float width, float height, Color color)
{
VectorLine squareLine = new VectorLine ("Square", new Vector2[8], null, 1.0f, LineType.Discrete, Joins.Weld);
squareLine.MakeRect (new Rect (posX, posY, width, height));
squareLine.SetColor (color);
squareLine.Draw ();
}
示例4: Start
// Use this for initialization
void Start()
{
if(!name.Contains("Circle")){
myLine = new VectorLine("myLine",new Vector3[]{ transform.position, nextObject.transform.position}, mat, 5f);
myLine.vectorObject.transform.parent = transform.parent.parent;
myLine.SetColor( GameObject.Find("Drawer").GetComponent<Renderer>().material.color);
// DrawLine.Instance.SetLineCollider(transform.position, nextObject.transform.position, gameObject);
}
else{
Vector3[] linePoints = new Vector3[60+1];
nextObject = gameObject;
myLine = new VectorLine("Circle", linePoints, null, 5f, LineType.Continuous, Joins.Weld);
myLine.vectorObject.transform.parent = transform.parent;
myLine.SetColor( GameObject.Find("Drawer").GetComponent<Renderer>().material.color);
transform.localScale = Vector3.one * radius*2;
}
}
示例5: EaseOut
IEnumerator EaseOut(VectorLine vectorLine, Color endColor)
{
var elapsed = 0F;
while (elapsed <= EaseDuration)
{
var c = Color.Lerp(StartColor, endColor, elapsed/EaseDuration);
elapsed += Time.deltaTime;
vectorLine.SetColor(c);
yield return null;
}
for (var i = 1; i <= 20; ++i)
{
var v0 = Vector3.Lerp(vectorLine.points3[0], vectorLine.points3[1], (float)(i-1) / 10);
var v1 = Vector3.Lerp(vectorLine.points3[0], vectorLine.points3[1], (float)i / 10);
FragManager.Instance.Make(v0, v1, endColor);
}
vectorLine.vectorObject.SetActive(false);
_pool.Enqueue(vectorLine);
}
示例6: Start
void Start () {
//VectorLine.SetCamera3D();
//Vector2[] linePoints = {new Vector2(0,0),new Vector2(1,1)};
//VectorLine myline = new VectorLine.SetLine(Color.green, new Vector2(0, 0), new Vector2(1, 1));
Vector2[] linePoints = { new Vector2(0, 0),new Vector2(1, 1)};
Material line = (Material)Resources.Load("Line");
VectorLine myline = new VectorLine("MyLine",linePoints,null,0.05f,LineType.Continuous);
//VectorLine.SetCanvasCamera (Camera.main);
//c.re
Rect r = new Rect(0,0,2,1);
//myline.make
myline.MakeRoundedRect(r, 0.2f,10);
myline.SetColor(Color.black);
myline.Draw();
}
示例7: InitLine
//Line methods
public void InitLine(){
if (myLine != null) {
VectorLine.Destroy(ref myLine);
}
myLine = new VectorLine("Line", followPoints, lineWidth,LineType.Continuous,Joins.Weld); // C#
if(_Data.userType == UserController.UserType.Azul)myLine.SetColor (Color.blue);
if(_Data.userType == UserController.UserType.Amarillo)myLine.SetColor (Color.yellow);
if(_Data.userType == UserController.UserType.Green)myLine.SetColor (Color.green);
if(_Data.userType == UserController.UserType.Rojo)myLine.SetColor (Color.red);
}
示例8: 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++;
//// }
//
//.........这里部分代码省略.........
示例9: 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);
}
}
}
示例10: createBorder
// void OnGUI()
// {
// if(draw_mode)
// {
// Vector3 spot_on_screen = Camera.main.WorldToScreenPoint (transform.position);
//// GUI.DrawTexture(new Rect(spot_on_screen.x - 100, Screen.height - spot_on_screen.y - 15, 200,30),
// GUI.Label(new Rect(spot_on_screen.x - 100, Screen.height - spot_on_screen.y - 15, 200,30),
// display_text,
// enginePlayerS.hover_text);
// }
//
// }
void createBorder()
{
border = pathDrawS.outlineHex(hex_data);
border.SetColor(enginePlayerS.select_color);
glow = pathDrawS.outlineHex(hex_data);
glow.lineWidth = border.lineWidth * 1.75F;
glow.SetColor(enginePlayerS.glow_color);
}
示例11: DrawGrid
/// <summary>
/// 画出网格
/// </summary>
public void DrawGrid()
{
for (int i = 0; i <= MAX_ROW; i++) {
Vector2 a = new Vector2 (0, Screen.height - i * rowStep);
Vector2 b = new Vector2 (Screen.width, Screen.height - i * rowStep);
VectorLine line = new VectorLine ("row" + i, new Vector2[]{a,b}, null, 1.0f);
line.SetColor (Color.red);
line.Draw ();
}
for (int j = 0; j <=MAX_COL; j++) {
Vector2 a = new Vector2 (j * colStep, 0);
Vector2 b = new Vector2 (j * colStep, Screen.height);
VectorLine line = new VectorLine ("col" + j, new Vector2[]{a,b}, null, 1.0f);
line.SetColor (Color.red);
line.Draw ();
}
}