質問編集履歴

2

誤字変更

2018/08/08 15:29

投稿

maimai19
maimai19

スコア9

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- ソースコードの下にあるif文のところで切り替えたいと思っています.
5
+ ソースコードにあるif文のところで切り替えたいと思っています.
6
6
 
7
7
 
8
8
 
@@ -10,95 +10,9 @@
10
10
 
11
11
  ```c#
12
12
 
13
- using System.Collections;
14
-
15
- using System.Collections.Generic;
16
-
17
- using UnityEngine;
18
-
19
- using UnityEngine.UI;
20
13
 
21
14
 
22
-
23
- public class BurgeraaGenetator : MonoBehaviour {
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
- public GameObject BurgerPrefab;
32
-
33
-
34
-
35
- GameObject director;
36
-
37
- GameObject Window;
38
-
39
- GameObject cbText;
40
-
41
-
42
-
43
-
44
-
45
- double cb= 0; //投げた個数
46
-
47
- double ouver = 80 * 10 ^ 6; //ガラス の応力[N/m^2]
48
-
49
- double omosa=122*10^-3; //バーガーの重さ[kg]
50
-
51
- double speed = 100 / 3.6; //速度[m/s]
52
-
53
- double sixyou = 5 * 10 - 3; //衝突時間[s]
54
-
55
- double uhen = 0;
56
-
57
-
58
-
59
- void Start(){
60
-
61
- this.director = GameObject.Find("GameDirector");
62
-
63
- this.cbText = GameObject.Find("CB");
64
-
65
- this.Window = GameObject.Find("Window");
66
-
67
- }
68
-
69
-
70
-
71
- void Update () {
72
-
73
-
74
-
75
-
76
-
77
- if(Input.GetMouseButtonDown(0)){
78
-
79
- GameObject Burger =Instantiate(BurgerPrefab) as GameObject;
80
-
81
-
82
-
83
- Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //マウスで押した方向にとばす
84
-
85
- Vector3 worldDir = ray.direction;
86
-
87
- Burger.GetComponent<BurgerController>().Shoot(worldDir.normalized * 2000);
88
-
89
-
90
-
91
-
92
-
93
- cb++;
94
-
95
- uhen = (omosa * cb * speed) / (sixyou); //質量*加速度
96
-
97
- this.cbText.GetComponent<Text>().text = this.cb.ToString() + "個投げた";
98
-
99
-
100
-
101
- if(ouver<uhen){ //ガラス 割らない
15
+ if(ouver<uhen){
102
16
 
103
17
  GetComponent(BreakableWindow).enabled =false;
104
18
 
@@ -112,14 +26,6 @@
112
26
 
113
27
 
114
28
 
115
- }
116
-
117
-
118
-
119
- }
120
-
121
- }
122
-
123
29
 
124
30
 
125
31
  ```

1

エラー画面の追加

2018/08/08 15:29

投稿

maimai19
maimai19

スコア9

test CHANGED
File without changes
test CHANGED
@@ -123,3 +123,7 @@
123
123
 
124
124
 
125
125
  ```
126
+
127
+
128
+
129
+ ![![イメージ説明](ccdc8e44c7f2ad000fe44df4ba02cb53.png)]