private void HandleSlice() { if (Input.GetMouseButtonDown(0)) { lineRenderer = new LineRendererManipulate(transform); Ray ray = MultiMeshManager.Instance.cam.ScreenPointToRay(Input.mousePosition); oldRay = ray; SliceMethods.SetIntersectedValue("first", ray); EventManager.Instance.Events.InvokeModeManipulate("StopAll"); } else if (Input.GetMouseButtonUp(0)) { EventManager.Instance.Events.InvokeModeManipulate("EndAll"); Ray ray = MultiMeshManager.Instance.cam.ScreenPointToRay(Input.mousePosition); SliceMethods.SetIntersectedValue("second", ray); GameObject[] SliceResult = SliceMethods.Slicing(); for (int i = 0; i < Size; i++) { LeftHeart[i] = SliceResult[SliceResultIndex++]; RightHeart[i] = SliceResult[SliceResultIndex++]; } mode = "select"; Destroy(lineRenderer.lineObject); } else if (Input.GetMouseButton(0)) { Ray ray = MultiMeshManager.Instance.cam.ScreenPointToRay(Input.mousePosition); lineRenderer.SetFixedLineRenderer(oldRay.origin + oldRay.direction * 100f, ray.origin + ray.direction * 100f); } }
private void FirstSet() { lineRenderer = new LineRendererManipulate(transform); isPatchUpdate = false; isLastPatch = false; oldPosition = Vector3.zero; patchCount = 0; }
void Awake() { heartMaterial = Resources.Load("Materials/Heart", typeof(Material)) as Material; lineRenderer = new LineRendererManipulate(transform); intersectedVerticesPos = new List <Vector3>(); rayList = new List <Ray>(); isFirst = true; isLast = false; isIntersected = true; boundaryCount = 0; Size = MultiMeshManager.Instance.Size; }
void Awake() { IncisionManager = this.gameObject.AddComponent <IncisionManager>(); oldExtendValue = 0; firstIncision = false; mode = "incision"; oldPosition = Vector3.zero; lineRenderer = new LineRendererManipulate(transform); // 꺼져있으면 못찾는구나. 그냥 생성을 해줄까. Object prefab = Resources.Load("Prefab/IncisionDistanceText"); incisionDistance = (GameObject)Instantiate(prefab); GameObject newCanvas = GameObject.Find("UICanvas"); incisionDistance.transform.SetParent(newCanvas.transform); incisionDistance.transform.localScale = Vector3.one; rectCanvas = newCanvas.GetComponent <Canvas>(); incisionDistance.SetActive(false); }
void Awake() { MeasureManager = new MeasureManager(); lineRenderer = new LineRendererManipulate(transform); }
void Awake() { MeasureManager = this.gameObject.AddComponent <MultiMeshMeasureManager>(); lineRenderer = new LineRendererManipulate(transform); }