コード例 #1
0
ファイル: TankHull.cs プロジェクト: ewingzhou/tanks
    void DrawMovePath()
    {
        if (movePathLines != null)
        {
            for (int i = 0; i < movePathLines.Count; i++)
            {
                VectorLine vl = movePathLines[i];
                VectorLine.Destroy(ref vl);
            }
        }

        movePathLines = new List <VectorLine>();

        for (int i = 0; i < movePath.Count; i++)
        {
            VectorLine vlo = new VectorLine("path", new List <Vector3>(5), null, 2.0f, LineType.Continuous);
            vlo.SetColor(tank.debugLineColor);
            vlo.MakeRect(Map.Instance.mapData[movePath[i].Key, movePath[i].Value].Pos + new Vector3(Map.Instance.cellSize / -2.0f, 0.11f, Map.Instance.cellSize / -2.0f),
                         Map.Instance.mapData[movePath[i].Key, movePath[i].Value].Pos + new Vector3(Map.Instance.cellSize / 2.0f, 0.11f, Map.Instance.cellSize / 2.0f));

            movePathLines.Add(vlo);
        }

        for (int i = 0; i < movePathLines.Count; i++)
        {
            movePathLines[i].Draw3D();
        }
    }
コード例 #2
0
ファイル: Map.cs プロジェクト: ewingzhou/tanks
    void DrawGridObstacles()
    {
        if (gridObstaclesLines != null)
        {
            for (int i = 0; i < gridObstaclesLines.Count; i++)
            {
                VectorLine vl = gridObstaclesLines[i];
                VectorLine.Destroy(ref vl);
            }
        }

        gridObstaclesLines = new List <VectorLine>();

        for (int row = 0; row < rows; row++)
        {
            for (int col = 0; col < cols; col++)
            {
                if (mapData[row, col].Obstacle != null)
                {
                    VectorLine vlo = new VectorLine("obs", new List <Vector3>(5), null, 2.0f, LineType.Continuous);
                    vlo.SetColor(mapData[row, col].Obstacle.isBreakable ? Color.blue : Color.cyan);
                    vlo.MakeRect(mapData[row, col].Pos + new Vector3(cellSize / -2.0f, 1.0f, cellSize / -2.0f),
                                 mapData[row, col].Pos + new Vector3(cellSize / 2.0f, 1.0f, cellSize / 2.0f));

                    gridObstaclesLines.Add(vlo);
                }
            }
        }

        for (int i = 0; i < gridObstaclesLines.Count; i++)
        {
            gridObstaclesLines[i].Draw3D();
        }
    }
コード例 #3
0
ファイル: Test.cs プロジェクト: goddie/u3dGameFramework
    /// <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
0
ファイル: Test.cs プロジェクト: ly774508966/u3dGameFramework
    /// <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();
    }
コード例 #5
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         originalPos = Input.mousePosition;
     }
     if (Input.GetMouseButton(0))
     {
         selectionLine.MakeRect(originalPos, Input.mousePosition);
         selectionLine.Draw();
     }
     selectionLine.textureOffset = -Time.time * 2.0f % 1;
 }
コード例 #6
0
    void Start()
    {
        rectLine = new VectorLine("Rects", new List <Vector3>(numberOfRects * 8), 2.0f);
        int idx = 0;

        for (int i = 0; i < numberOfRects; i++)
        {
            rectLine.MakeRect(new Rect(Random.Range(-5.0f, 5.0f), Random.Range(-5.0f, 5.0f), Random.Range(0.25f, 3.0f), Random.Range(0.25f, 2.0f)), idx);
            idx += 8;
        }
        rectLine.color         = lineColor;
        rectLine.capLength     = 1.0f;
        rectLine.drawTransform = transform;
        rectLine.SetMask(mask);

        startPos = transform.position;
    }
コード例 #7
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         StopCoroutine("CycleColor");
         selectionLine.SetColor(Color.white);
         originalPos = Input.mousePosition;
     }
     if (Input.GetMouseButton(0))
     {
         selectionLine.MakeRect(originalPos, Input.mousePosition);
         selectionLine.Draw();
     }
     if (Input.GetMouseButtonUp(0))
     {
         StartCoroutine("CycleColor");
     }
 }
コード例 #8
0
    public void Initialize( )
    {
        SUCCESS_DIST = Screen.width * 0.035f;
        Debug.Log(SUCCESS_DIST);

        target_lines = new VectorLine("target_lines", new Vector2[8], Color.black, null, 4);

        //float w = target_screen_rect.width * Screen.width;

        float max_w = Screen.height * aspect_ratio.x / aspect_ratio.y;
        float min_w = Screen.width / 15;

        float max_h = Screen.width * aspect_ratio.y / aspect_ratio.x;
        float min_h = Screen.height / 15;

        float w = Random.RandomRange(min_w, max_w);
        float h = w * aspect_ratio.y / aspect_ratio.x / ((float)Screen.width / (float)Screen.height);   //target_screen_rect.height * Screen.height;

        while (h > max_h || h < min_h)
        {
            Debug.Log("Was of improper y");
            w = Random.RandomRange(min_w, max_w);
            h = w * aspect_ratio.y / aspect_ratio.x / ((float)Screen.width / (float)Screen.height);
        }

        float x = Random.RandomRange(0, Screen.width - w); //target_screen_rect.x * Screen.width;
        float y = Random.RandomRange(h, Screen.height);    //target_screen_rect.y * Screen.height;

        target_size = new Rect(x, y, w, h);


        target_lines.MakeRect(target_size);
        target_lines.Draw( );

        top_left  = new Vector2(target_size.xMin, target_size.yMax);    // - target_size.height );
        top_right = new Vector2(target_size.xMax, target_size.yMax);    // - target_size.height );

        bottom_left  = new Vector2(target_size.xMin, target_size.yMin); // - target_size.height );
        bottom_right = new Vector2(target_size.xMax, target_size.yMin); // - target_size.height );

        initialized = true;
    }
コード例 #9
0
        public void Draw()
        {
            if (VectorLine == null || !_renderer)
            {
                return;
            }

            var bounds = _renderer.bounds;

            if (_childRenderers.Length > 0)
            {
                bounds.Encapsulate(BoundsUtils.CombineBounds(_childRenderers));
            }

            var rect = bounds.BoundsToScreenRect(Camera.main);

            VectorLine.MakeRect(rect);
            VectorLine.SetColor(_renderer.gameObject.activeInHierarchy ? new Color(0.4f, 0.95f, 0.4f) : new Color(0.65f, 0.65f, 0.65f));
            VectorLine.Draw();
        }
コード例 #10
0
    void Update()
    {
        // Don't allow clicking in the left-most 50 pixels (where the slider is), or if the spheres are currently fading
        if (Input.GetMouseButtonDown(0) && Input.mousePosition.x > 50 && !fading)
        {
            // If neither shift key is down, reset selection
            if (!(Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) && selectIndex > 0)
            {
                ResetSelection(true);
            }
            // See if we clicked on an object (the room is set to the IgnoreRaycast layer, so we can't select it)
            if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
            {
                spheres[selectIndex]       = hit.collider.gameObject;
                spheres[selectIndex].layer = ignoreLayer;                                           // So it can't be clicked again (unless reset)
                spheres[selectIndex].GetComponent <Renderer>().material.EnableKeyword("_EMISSION"); // So changing emission color will work at runtime
                selectIndex++;
                line.Resize(selectIndex * 10);
            }
        }

        // Draw a square for each selected object
        for (int i = 0; i < selectIndex; i++)
        {
            // Make the size of the square larger or smaller depending on the object's Z distance from the camera
            var squareSize  = (Screen.height * selectionSize) / Camera.main.transform.InverseTransformPoint(spheres[i].transform.position).z;
            var screenPoint = Camera.main.WorldToScreenPoint(spheres[i].transform.position);
            var thisSquare  = new Rect(screenPoint.x - squareSize, screenPoint.y - squareSize, squareSize * 2, squareSize * 2);
            line.MakeRect(thisSquare, i * 10);
            // Make a line connecting from the midpoint of the square's left edge to the energyLevel slider position
            line.points2[i * 10 + 8] = new Vector2(thisSquare.x - lineWidth * .25f, thisSquare.y + squareSize);
            line.points2[i * 10 + 9] = new Vector2(35, Mathf.Lerp(65, Screen.height - 25, energyLevel));
            // Change color of selected objects
            spheres[i].GetComponent <Renderer>().material.SetColor("_EmissionColor", new Color(energyLevel, energyLevel, energyLevel));
        }
    }
コード例 #11
0
	/// <summary>
	/// Draw cells for debugging purposes only
	/// </summary>
	/// <param name="cells">Cells.</param>
	private void DrawCells(List<Cell> cells)
	{
		// Calculate point count for Discrete type of line that will contain Rects
		int pointCount = cells.Count * 8;
		// Clear all debug lines each time (no exception if null)
		VectorLine.Destroy(ref debugCellLine);
		VectorLine.Destroy(ref debugPaddingLine);
		
		// Build line with proper parameters
		debugCellLine = new VectorLine("DebugCellLine", new Vector2[pointCount], null, 2, LineType.Discrete, Joins.Weld);
		debugCellLine.color = gridviewParameters.gridColor;
		debugPaddingLine = new VectorLine("DebugPaddingCellLine", new Vector2[pointCount], null, 2, LineType.Discrete, Joins.Weld);
		debugPaddingLine.color = gridviewParameters.paddingCellColor;
		
		// Build each Cell
		for(int i = 0; i < cells.Count; i++)
		{
			Cell cell = cells[i];
			debugCellLine.MakeRect(cell.GetRectPoints(), i*8); 
			debugPaddingLine.MakeRect(cell.GetPaddinRectPosition(), i*8);
		}
		
		// Show results
		debugCellLine.Draw();
		debugPaddingLine.Draw();
	}
コード例 #12
0
	private void DrawPanel()
	{
		int pointCount = 8;

		// Build debug panel line with proper parameters
		debugPanelLine = new VectorLine("DebugPanelLine", new Vector2[pointCount], null, 2, LineType.Discrete, Joins.Weld);
		debugPanelLine.color = gridviewParameters.panelColor;

		//Get panel size
		Vector2 size = new Vector2(panel.finalClipRegion.z, panel.finalClipRegion.w);

		//Get panel position
		Vector2 position = new Vector2(panel.finalClipRegion.x + panel.transform.localPosition.x + Screen.width / 2f - size.x / 2f, 
		                               panel.finalClipRegion.y + panel.transform.localPosition.y + Screen.height / 2f - size.y / 2f);

		//Draw panel rect
		Rect rect = new Rect(position, size);
		debugPanelLine.MakeRect(rect);
		debugPanelLine.Draw();
	}
コード例 #13
0
ファイル: LineDrawer.cs プロジェクト: kadirfu/fizikotesi
    // Use this for initialization
    void Start()
    {
        //vectorCam = VectorLine.GetCamera();

        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;
        }
        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;
        }

        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;
        }

        linePointsY=new Vector2[(maxH/snToPixel)*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;
        }

        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[2]{new Vector2(minW,minH),new Vector2(minW,minH)}, Color.white, lineMaterial, 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 ();

        allGuide=new VectorLine("Guide",new Vector2[4]{new Vector2(minW,minH),new Vector2(minW,maxH+minH),new Vector2(minW,Screen.height/2),new Vector2(maxW+minW,Screen.height/2)},null,3f,LineType.Discrete);
        allGuide.Draw ();

        /*
        plane.transform.localScale = new Vector3 ((float)(1.35f*maxW)/(float)(Screen.width),0.1f,(float)(Screen.height-minH*2)/(float)Screen.height);
        plane.transform.position = new Vector3(plane.transform.position.x,plane.transform.position.y,Camera.main.transform.position.z+1);
        */

        box.x = -Screen.width/2+minW;
        box.y= -Screen.height/2+minH;
        box.width = maxW;
        box.height = maxH;
        BG.guiTexture.pixelInset = box;

        rectV = new VectorLine ("Rectangle",new Vector2[8],Color.black,null,4f);
        rectV.capLength = 2;
        rectV.MakeRect (new Rect (minW,  Screen.height -  minH, maxW, maxH));
        rectV.Draw();
    }
コード例 #14
0
 /// <summary>
 /// 绘制矩形:Rect左上角为起点
 /// </summary>
 /// <param name="posX"></param>
 /// <param name="posY"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="color"></param>
 private void CreateRect(float posX, float posY, float width, float height, Color color)
 {
     squareLine.MakeRect(new Rect(posX, posY, width, height));
     squareLine.SetColor(color);
     squareLine.Draw();
 }
コード例 #15
0
ファイル: MakeSL.cs プロジェクト: kadirfu/fizikotesi
    void OnGUI()
    {
        // Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
        if (!showDrawingTools) {
                        if (GUI.Button (new Rect (Screen.width - 150, Screen.height - 50, 150, 50), "Start Drawing")) {
                                showDrawingTools = true;
                        }
                } else if (!drawingDone) {
                        if (GUI.Button (new Rect (Screen.width - 150, Screen.height - 50, 150, 50), "Done")) {
                                drawingDone = true;
                        }
                } else if (!showVectorDrawing) {
                        if (GUI.Button (new Rect (Screen.width - 150, Screen.height - 100, 150, 50), "Draw V-T Graph")) {
                                showVectorDrawing = true;
                        }

                        if (GUI.Button (new Rect (Screen.width - 150, Screen.height - 50, 150, 50), "Back To The Schene")) {
                                //Buraya Kamera değiştirme scripti gelcek.

                                VectorLine.Destroy (ref allGuide);
                                VectorLine.Destroy (ref atGraphAfterVt);
                                VectorLine.Destroy (ref gecici);
                                VectorLine.Destroy (ref guideY);
                                VectorLine.Destroy (ref line);
                                VectorLine.Destroy (ref rectV);
                                VectorLine.Destroy (ref refPointsOnX);
                                VectorLine.Destroy (ref refPointsOnY);
                                VectorLine.Destroy (ref textVec);
                                VectorLine.Destroy (ref vtGraph);
                                VectorPoints.Destroy (ref dots);

                                for (int i =0; i<linePointsYNmb.Length;i++) {

                                    VectorLine.Destroy (ref linePointsYNmb[i]);

                                }
                                for (int i =0; i<textVectors.Length;i++){

                                    VectorLine.Destroy (ref textVectors[i]);

                                }

                                finish = true;
                                walkOrDraw.btnClicked=false;

                        }
                } else {

                        if (GUI.Button (new Rect (Screen.width - 150, Screen.height - 100, 150, 50), "Reset")) {

                showDrawingTools=false;
                showVectorDrawing=false;
                drawingDone=false;

                                    VectorLine.Destroy(ref dots);
                                   VectorLine.Destroy(ref line);

                VectorLine.Destroy(ref vtGraph);
                                   VectorLine.Destroy(ref atGraphAfterVt);
                VectorLine.Destroy(ref refPointsOnX);
                VectorLine.Destroy(ref refPointsOnY);

                            for (int i=0; i<50; i++) {
                                VectorLine.Destroy(ref textVectors[i]);
                                textVectors[i]=new VectorLine("Text"+i,new Vector2[2]{new Vector2(0,0),new Vector2(0,0)},null,2f,LineType.Discrete,Joins.Weld);

                            }

                            for (int i=0; i<100; i++) {
                                linePoints[i]=Vector2.zero;
                            }

                            for(int i=0;i<100;i++){
                                atGraphAfterVtPoints[i]=Vector2.zero;
                            }

                            for (int i=0; i<49; i++) {
                                canerinArray[i]=Vector2.zero;
                            }

                            for (int i=0; i<49; i++) {
                                VelocityArray[i]=Vector2.zero;
                            }

                            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ı

                            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 ();

                            allGuide=new VectorLine("Guide",new Vector2[4]{new Vector2(minW,minH),new Vector2(minW,maxH+minH),new Vector2(minW,Screen.height/2),new Vector2(maxW+minW,Screen.height/2)},null,3f,LineType.Discrete);
                            allGuide.Draw ();

                            /*
                    plane.transform.localScale = new Vector3 ((float)(1.35f*maxW)/(float)(Screen.width),0.1f,(float)(Screen.height-minH*2)/(float)Screen.height);
                    plane.transform.position = new Vector3(plane.transform.position.x,plane.transform.position.y,Camera.main.transform.position.z+1);
                    */

                            box.x = -Screen.width/2+minW;
                            box.y= -Screen.height/2+minH;
                            box.width = maxW;
                            box.height = maxH;
                            bg.pixelInset = box;

                            rectV = new VectorLine ("Rectangle",new Vector2[8],Color.black,null,4f);
                            rectV.capLength = 2;
                            rectV.MakeRect (new Rect (minW,  Screen.height -  minH, maxW, maxH));
                            rectV.Draw();

                        }

                        if (GUI.Button (new Rect (Screen.width - 150, Screen.height - 50, 150, 50), "Back To The Schene")) {
                            //Buraya Kamera değiştirme scripti gelcek.
                            VectorLine.Destroy (ref allGuide);
                            VectorLine.Destroy (ref atGraphAfterVt);
                            VectorLine.Destroy (ref gecici);
                            VectorLine.Destroy (ref guideY);
                            VectorLine.Destroy (ref line);
                            VectorLine.Destroy (ref rectV);
                            VectorLine.Destroy (ref refPointsOnX);
                            VectorLine.Destroy (ref refPointsOnY);
                            VectorLine.Destroy (ref textVec);
                            VectorLine.Destroy (ref vtGraph);
                            VectorPoints.Destroy (ref dots);

                            for (int i =0; i<linePointsYNmb.Length;i++) {

                                VectorLine.Destroy (ref linePointsYNmb[i]);

                            }
                            for (int i =0; i<textVectors.Length;i++){

                                VectorLine.Destroy (ref textVectors[i]);

                            }

                            finish = true;
                            walkOrDraw.btnClicked=false;

                        }

                }
    }
コード例 #16
0
ファイル: MakeSL.cs プロジェクト: kadirfu/fizikotesi
    // 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 ();

        allGuide=new VectorLine("Guide",new Vector2[4]{new Vector2(minW,minH),new Vector2(minW,maxH+minH),new Vector2(minW,Screen.height/2),new Vector2(maxW+minW,Screen.height/2)},null,3f,LineType.Discrete);
        allGuide.Draw ();

        /*
        plane.transform.localScale = new Vector3 ((float)(1.35f*maxW)/(float)(Screen.width),0.1f,(float)(Screen.height-minH*2)/(float)Screen.height);
        plane.transform.position = new Vector3(plane.transform.position.x,plane.transform.position.y,Camera.main.transform.position.z+1);
        */

        box.x = -Screen.width/2+minW;
        box.y= -Screen.height/2+minH;
        box.width = maxW;
        box.height = maxH;
        bg.pixelInset = box;

        rectV = new VectorLine ("Rectangle",new Vector2[8],Color.black,null,4f);
        rectV.capLength = 2;
        rectV.MakeRect (new Rect (minW,  Screen.height -  minH, maxW, maxH));
        rectV.Draw();

        SetLine();
    }