void DrawExtraGUI(DrawingLine script) { if (GUILayout.Button("Create Line")) { script.createLine(); } }
static public int HelperExport(string L) { Testing.Initialize(); var testObj2 = new DrawingLine { name = "testName2", parentName = "", x = 1111, y = 222, x2 = 123, y2 = 312, zOrder = 311, visible = true, color = 231 }; EventHandler.AddEventHandler(ElmaFunction.SetLGR, 0, new[] { "army" }); EventHandler.AddEventHandler(ElmaFunction.SetAcceleration, 0, new[] { "1200" }); while (true) { Draw.DrawObject(testObj2); Thread.Sleep(1000); } return(0); }
public override void OnInspectorGUI() { DrawingLine drawingLineScript = (DrawingLine)target; DrawDefaultInspector(); DrawExtraGUI(drawingLineScript); }
public void StopDrawing() { if (currentLine == null) { return; } currentLine = null; }
static public DrawingLine Construct() { DrawingLine dl = new DrawingLine { input = new Annal <InputData>(8, InputData.Construct()), go = null }; return(dl); }
void Start() { _board = transform.Find("Whiteboard").gameObject; HMDInputManager.LeftGetTouchPadClickDown += CleanWhiteboard; HMDInputManager.RightGetTouchPadClickDown += WhiteboardSwitch; GameObject gameObject = transform.Find("DrawingLine").gameObject; _drawingLine = gameObject.GetComponent <DrawingLine>(); }
IEnumerator hideAfter(DrawingLine line) { yield return(new WaitForSeconds(0.0f)); unlockOrder[currentIndex].gameObject.SetActive(false); //show the elements foreach (GameObject obj in line.allObjectsToShow) { obj.SetActive(true); } }
void StartLine(Vector3 position, Quaternion rotation) { if (currentLine != null) { return; } var currentLineObject = GameObject.Instantiate(linePrefab, position, rotation); currentLine = currentLineObject.GetComponent <DrawingLine>(); if (currentLine == null) { Debug.LogError("Missconfigured line prefab"); } }
public static DrawingLine ReadDrawingLine(string text) { DrawingLine line = new DrawingLine(); string[] pairs = text.Split(new char[] { '\n' }, System.StringSplitOptions.RemoveEmptyEntries); string colorString = pairs[0]; line.Color = ParseColor(colorString); for (int i = 1; i < pairs.Length; i++) { Vector2 point = ParsePoint(pairs[i]); line.Points.Add(point); } return(line); }
public static DrawingData ParseDrawing(string file) { DrawingData drawFile = new DrawingData(); string[] lines = file.Replace("\r\n", "\n") .Replace("\r", "\n") .Split(new string[] { "line\n" }, System.StringSplitOptions.RemoveEmptyEntries); //string[] lines = file.Split(new string[] { "line" }, System.StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < lines.Length; i++) { DrawingLine line = ReadDrawingLine(lines[i]); drawFile.Lines.Add(line); } return(drawFile); }
public static void replacePoints() { //get the selected obj Transform[] selectedObjs = Selection.GetTransforms(SelectionMode.Unfiltered); foreach (Transform selectedObj in selectedObjs) { //selected drawing line DrawingLine drawLine = selectedObj.GetComponent <DrawingLine>(); //get all the linepoints inside it LinePoint[] allLinePoints = selectedObj.GetComponentsInChildren <LinePoint>(true); print("size of all line POints are " + allLinePoints.Length); //step through all line points int counter = 0; foreach (LinePoint lp in allLinePoints) { GameObject newObj = PrefabUtility.InstantiatePrefab(Resources.Load("point", typeof(GameObject))) as GameObject; newObj.name = "point_" + (counter + 1).ToString("00"); //and replace the point with an instance from the prefab newObj.transform.SetParent(selectedObj); //set the position newObj.transform.position = lp.transform.position; //set the drawing line to the point LinePoint newLinePoint = newObj.GetComponent <LinePoint>(); newLinePoint.mDrawingLine = drawLine; newLinePoint.ID = counter + 1; newLinePoint.idText.text = (counter + 1).ToString(); //set the linepoint in the drawing line drawLine.allPoints[counter] = newLinePoint; counter++; } //step through the original line points and destroy them foreach (LinePoint lp in allLinePoints) { //delete the lp DestroyImmediate(lp.gameObject); } } }
public void unlockNext(DrawingLine line) { //if we still have to show a curve we show the next if (currentIndex < unlockOrder.Count - 1) { StartCoroutine(unlockNextAfter(line)); } else { //here we would show the final unlock StartCoroutine(hideAfter(line)); //plays the level finsihed sequence StartCoroutine(levelFinishedSequence()); } }
/// <summary> /// Shows the next line /// </summary> IEnumerator unlockNextAfter(DrawingLine line) { //hide the curve unlockOrder[currentIndex].gameObject.SetActive(false); //show the elements foreach (GameObject obj in line.allObjectsToShow) { obj.SetActive(true); } currentIndex += 1; //wait a bit before we show the next curve yield return(new WaitForSeconds(0.1f)); unlockOrder[currentIndex].gameObject.SetActive(true); }
/// <summary> /// Applies Vertices into the Graphical Pipeline and draws them onto the screen buffer. /// </summary> public void Draw() { var aa = DrawingLine.Antialias; var width = DrawingLine.Width; var lines = DrawingLine.GLLines; DrawingLine.Antialias = Antialias; DrawingLine.Width = Width; DrawingLine.GLLines = true; DrawingLine.Begin(); DrawingLine.Draw(Vertices, Color); DrawingLine.End(); DrawingLine.Antialias = aa; DrawingLine.Width = width; DrawingLine.GLLines = lines; }
/// <summary> /// Line Dispose. /// </summary> public void Dispose() { _line.Dispose(); DrawingLine.Dispose(); }
public void DrawLine(DrawingLine line, int padNumber) { throw new NotImplementedException(); }