質問編集履歴

4

2021/03/28 08:47

投稿

s_1217
s_1217

スコア1

test CHANGED
File without changes
test CHANGED
@@ -209,3 +209,57 @@
209
209
  ⑥Assets\IgaguriController.cs(11,9): error CS0103: The name 'GetComponet' does not exist in the current context
210
210
 
211
211
  ⑦ Assets\IgaguriController.cs(16,22): error CS0246: The type or namespace name 'Rigibody' could not be found (are you missing a using directive or an assembly reference?)
212
+
213
+
214
+
215
+ 今のIgaguriControllerのプログラム内容です。
216
+
217
+ ```
218
+
219
+
220
+
221
+ using System.Collections;
222
+
223
+ using System.Collections.Generic;
224
+
225
+ using UnityEngine;
226
+
227
+
228
+
229
+ public class IgaguriController : MonoBehaviour
230
+
231
+ {
232
+
233
+ public void Shoot(Vector3 dir)
234
+
235
+ {
236
+
237
+ GetComponent<Rigidbody>().AddForce(dir);
238
+
239
+ }
240
+
241
+
242
+
243
+ void OnCollisionEnter(Collision other)
244
+
245
+ {
246
+
247
+ GetComponent<Rigibody>().isKinematic = true;
248
+
249
+ GetComponent<ParticleSystem>().Play();
250
+
251
+ }
252
+
253
+
254
+
255
+ void Start()
256
+
257
+ {
258
+
259
+ Shoot(new Vector3(0, 200, 2000));
260
+
261
+ }
262
+
263
+
264
+
265
+ ```

3

2021/03/28 08:47

投稿

s_1217
s_1217

スコア1

test CHANGED
File without changes
test CHANGED
@@ -191,3 +191,21 @@
191
191
 
192
192
 
193
193
  参考にしているのは「はじめてでも安心!Unityの教科書 Unity2020完全対応版 2D&3Dスマートフォンゲーム入門講座」の本です。
194
+
195
+
196
+
197
+
198
+
199
+ (追記)
200
+
201
+ ①~⑤のエラーは消えました。
202
+
203
+ 次にまたエラーが出てしまいました。
204
+
205
+ 修正方法を教えて頂きたいです。
206
+
207
+ エラー内容
208
+
209
+ ⑥Assets\IgaguriController.cs(11,9): error CS0103: The name 'GetComponet' does not exist in the current context
210
+
211
+ ⑦ Assets\IgaguriController.cs(16,22): error CS0246: The type or namespace name 'Rigibody' could not be found (are you missing a using directive or an assembly reference?)

2

2021/03/28 04:10

投稿

s_1217
s_1217

スコア1

test CHANGED
File without changes
test CHANGED
@@ -126,6 +126,14 @@
126
126
 
127
127
 
128
128
 
129
+ 動かそうすると
130
+
131
+ All compiler errors have to be fixed before you can enter playmode!:
132
+
133
+ がでています。
134
+
135
+
136
+
129
137
  エラーは5つ出ています。
130
138
 
131
139
  ① ReleaseAllScriptCaches did not release all script caches!

1

2021/03/28 03:41

投稿

s_1217
s_1217

スコア1

test CHANGED
File without changes
test CHANGED
@@ -70,9 +70,11 @@
70
70
 
71
71
  ```
72
72
 
73
- ```
73
+
74
74
 
75
75
  これがIgaguriGeneratorのプログラムです。
76
+
77
+
76
78
 
77
79
  ```
78
80
 
@@ -124,4 +126,60 @@
124
126
 
125
127
 
126
128
 
129
+ エラーは5つ出ています。
130
+
131
+ ① ReleaseAllScriptCaches did not release all script caches!
132
+
133
+ ② NullReferenceException: Object reference not set to an instance of an object
134
+
135
+ UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
136
+
137
+ Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
138
+
139
+ UnityEditor.EditorWindow.CreateRoot () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
140
+
141
+ UnityEditor.EditorWindow.get_rootVisualElement () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
142
+
143
+ UnityEditor.HostView.RegisterSelectedPane (System.Boolean sendEvents) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
144
+
145
+ UnityEditor.HostView.OnEnable () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
146
+
147
+ ③ NullReferenceException: Object reference not set to an instance of an object
148
+
149
+ UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
150
+
151
+ Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
152
+
153
+ UnityEditor.EditorWindow.CreateRoot () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
154
+
155
+ UnityEditor.EditorWindow.get_rootVisualElement () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
156
+
157
+ UnityEditor.HostView.UpdateViewMargins (UnityEditor.EditorWindow view) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
158
+
159
+ UnityEditor.HostView.SetWindow (UnityEditor.ContainerWindow win) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
160
+
161
+ UnityEditor.View.Initialize (UnityEditor.ContainerWindow win) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
162
+
163
+ UnityEditor.ContainerWindow.OnEnable () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
164
+
165
+ ④ NullReferenceException: Object reference not set to an instance of an object
166
+
167
+ UnityEditor.UIElements.UIElementsEditorUtility..cctor () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
168
+
169
+ Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.UIElements.UIElementsEditorUtility' threw an exception.
170
+
171
+ UnityEditor.EditorWindow.CreateRoot () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
172
+
173
+ UnityEditor.EditorWindow.get_rootVisualElement () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
174
+
175
+ UnityEditor.HostView.DeregisterSelectedPane (System.Boolean clearActualView, System.Boolean sendEvents) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
176
+
177
+ UnityEditor.HostView.OnDisable () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
178
+
179
+ ⑤ Assets\IgaguriController.cs(5,19): error CS0116: A namespace cannot directly contain members such as fields or methods
180
+
181
+
182
+
183
+
184
+
127
185
  参考にしているのは「はじめてでも安心!Unityの教科書 Unity2020完全対応版 2D&3Dスマートフォンゲーム入門講座」の本です。