質問編集履歴
2
コードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,7 +11,35 @@
|
|
11
11
|
```
|
12
12
|
|
13
13
|
### 該当のソースコード
|
14
|
+
using System.Collections;
|
15
|
+
using System.Collections.Generic;
|
16
|
+
using UnityEngine;
|
14
17
|
|
18
|
+
public class Move : MonoBehaviour
|
19
|
+
{
|
20
|
+
GameObject Myball;
|
21
|
+
GameObject Enemy;
|
22
|
+
|
23
|
+
// Use this for initialization
|
24
|
+
void Start()
|
25
|
+
{
|
26
|
+
this.pos1 = GameObject.Find("Myball");
|
27
|
+
this.pos2 = GameObject.Find("Enemy");
|
28
|
+
}
|
29
|
+
|
30
|
+
this.pos1Z = this.pos1.transform.position.z;
|
31
|
+
this.pos2X = this.pos2.transform.position.x;
|
32
|
+
// Update is called once per frame
|
33
|
+
void Update()
|
34
|
+
{
|
35
|
+
if (pos2X>-10)
|
36
|
+
{
|
37
|
+
tratnsform.Translate(0.1f, 0f, 0f);
|
38
|
+
}
|
39
|
+
|
40
|
+
}
|
41
|
+
|
42
|
+
}
|
15
43
|
```ここに言語名を入力
|
16
44
|
ソースコード
|
17
45
|
```
|
1
Unityの追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|