回答編集履歴
1
ソースを修正しました
test
CHANGED
@@ -8,6 +8,24 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
修正
|
12
12
|
|
13
|
+
相対位置で動かすのなら、こうかな?
|
14
|
+
|
15
|
+
```
|
16
|
+
|
17
|
+
if (Input.GetMouseButtonDown(0))
|
18
|
+
|
19
|
+
{
|
20
|
+
|
21
|
+
this.origin = transform.position;
|
22
|
+
|
23
|
+
this.mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
24
|
+
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
|
13
|
-
transform.position = t
|
29
|
+
transform.position = this.origin + (new Vector3(mouse_x, mouse_y, 0f));
|
30
|
+
|
31
|
+
```
|