void StartDrawing() { results = new List <RaycastResult>(); Ray r = cam.ScreenPointToRay(Input.mousePosition); Raycaster.Raycast(new PointerEventData(EventSystem) { position = Input.mousePosition }, results); invalid = Physics2D.Raycast(r.origin, r.direction).collider != null | results.Count > 0; if (invalid) { return; } drawMgr.Active = true; positions.Clear(); lastPos = cam.ScreenToWorldPoint(Input.mousePosition); drawnObj = drawMgr.DrawnObject(lastPos); SetLineEdge(); }
void Start() { points = new Vector3[point_count]; path = gameObject.AddComponent <DrawnObject>(); path.isCircle = false; path.mat = mat; path.width = 1f; path.points = points; path.loop = false; path.worldspace = true; darea = gameObject.AddComponent <DeathArea>(); darea.radius = start_size; Random_Cloud(); }
void Start() { points = new Vector3[length]; // set depth on the path for (int i = 0; i < length; i++) { points[i].x = 0; points[i].y = 0; points[i].z = (i * (1f / length)); } path = gameObject.AddComponent <DrawnObject>(); path.isCircle = false; path.mat = mat; path.width = 1f; path.points = points; path.loop = false; path.worldspace = true; }