- 289 名前:名前は開発中のものです。 mailto:sage [2015/03/13(金) 03:32:58.03 ID:PSdOCtAF.net]
- void Update() {
LineRenderer lineRenderer = GetComponent<LineRenderer>(); if (Input.GetMouseButton (0)) { float x = Input.mousePosition.x; float y = Input.mousePosition.y; Vector2 v = Camera.main.WorldToScreenPoint(transform.position); float dx = x-v.x; float dy = y-v.y; lineRenderer.SetPosition (0, new Vector3(0,0,0)); lineRenderer.SetPosition (1, new Vector3(dx,dy,0)); これで原点からマウスでクリックしたところまで線を引きたいんだけどちょっとそれよりも長くなっちゃうんだけどどこが変なんだ? }
|

|