当前位置: 首页>>代码示例>>C#>>正文


C# VectorLine.SetColor方法代码示例

本文整理汇总了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
开发者ID:JohnMalmsteen,项目名称:mobile-apps-tower-defense,代码行数:26,代码来源:DrawGrid.cs

示例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 ();
        }
    }
开发者ID:goddie,项目名称:u3dGameFramework,代码行数:56,代码来源:Test.cs

示例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 ();
    }
开发者ID:goddie,项目名称:u3dGameFramework,代码行数:13,代码来源:Test.cs

示例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;
     }
 }
开发者ID:wang-yichun,项目名称:ETools,代码行数:18,代码来源:LineObject.cs

示例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);
 }
开发者ID:rapina,项目名称:technicolor,代码行数:19,代码来源:Graph.cs

示例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();
	
	}
开发者ID:aanupam3,项目名称:PIAB-Unity-master,代码行数:21,代码来源:classicalTutorial.cs

示例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);

	}
开发者ID:Bimehackaton,项目名称:proyecto-6,代码行数:15,代码来源:FestivalUserBehaviour.cs

示例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++;
        ////				}
        //
//.........这里部分代码省略.........
开发者ID:duanpeijian,项目名称:unity-drawline,代码行数:101,代码来源:DrawGrid2.cs

示例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);  
            }
        }  
    }
开发者ID:Keshire,项目名称:Unity-polygon-map-generation,代码行数:58,代码来源:MapDraw.cs

示例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);
 }
开发者ID:ChrisRenke,项目名称:Precursor,代码行数:20,代码来源:engineHexS.cs

示例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 ();
        }
    }
开发者ID:goddie,项目名称:u3dGameFramework,代码行数:26,代码来源:MapUtil.cs


注:本文中的VectorLine.SetColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。