質問編集履歴
5
フォルダ構成を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -154,4 +154,49 @@
|
|
154
154
|
|
155
155
|
|
156
156
|
}
|
157
|
+
```
|
158
|
+
|
159
|
+
### フォルダ構成
|
160
|
+
|
161
|
+
```txt
|
162
|
+
|
163
|
+
C:.
|
164
|
+
│ Igaguri.csproj
|
165
|
+
│ Igaguri.sln
|
166
|
+
│ Igaguri_Android.apk
|
167
|
+
│
|
168
|
+
├─Assets
|
169
|
+
│ │ GameScene.unity
|
170
|
+
│ │ igaguri.fbx
|
171
|
+
│ │ IgaguriController.cs
|
172
|
+
│ │ IgaguriGenerator.cs
|
173
|
+
│ │ igaguriPrefab.prefab
|
174
|
+
│ │ New Terrain 1.asset
|
175
|
+
│ │ New Terrain.asset
|
176
|
+
│ │ target.fbx
|
177
|
+
│ │ test.prefab
|
178
|
+
│ │
|
179
|
+
│ └─Standard Assets
|
180
|
+
│
|
181
|
+
├─ProjectSettings
|
182
|
+
│ AudioManager.asset
|
183
|
+
│ ClusterInputManager.asset
|
184
|
+
│ DynamicsManager.asset
|
185
|
+
│ EditorBuildSettings.asset
|
186
|
+
│ EditorSettings.asset
|
187
|
+
│ GraphicsSettings.asset
|
188
|
+
│ InputManager.asset
|
189
|
+
│ NavMeshAreas.asset
|
190
|
+
│ NetworkManager.asset
|
191
|
+
│ Physics2DSettings.asset
|
192
|
+
│ ProjectSettings.asset
|
193
|
+
│ ProjectVersion.txt
|
194
|
+
│ QualitySettings.asset
|
195
|
+
│ TagManager.asset
|
196
|
+
│ TimeManager.asset
|
197
|
+
│ UnityConnectSettings.asset
|
198
|
+
│
|
199
|
+
└─UnityPackageManager
|
200
|
+
manifest.json
|
201
|
+
|
157
202
|
```
|
4
サンプルソースコードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
# 背景
|
9
9
|
「[Unityの教科書 Unity 2017完全対応版](http://www.sbcr.jp/products/4797393521.html)」という技術書で、Unityを勉強しています。
|
10
10
|
7章の「3Dゲームの作り方」に挑戦しています。
|
11
|
+
[Sampleソースコード](http://www.sbcr.jp/support/14129.html)
|
11
12
|
Unity上の実行ツールで、正しく動くことは確認できました。
|
12
13
|
|
13
14
|

|
3
画像追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
7章の「3Dゲームの作り方」に挑戦しています。
|
11
11
|
Unity上の実行ツールで、正しく動くことは確認できました。
|
12
12
|
|
13
|
+

|
14
|
+
|
13
15
|
# 問題
|
14
16
|
Unityの「Build & Run」でAndroidにインストールして、アプリを起動しました。
|
15
17
|
すると、Unityロゴが表示されたあと、アプリが終了してしまいました。
|
2
ソースコードの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -85,4 +85,70 @@
|
|
85
85
|
|
86
86
|
|
87
87
|
# 質問
|
88
|
-
上記の問題を解決する方法を教えていただきたいです。
|
88
|
+
上記の問題を解決する方法を教えていただきたいです。
|
89
|
+
|
90
|
+
|
91
|
+
# 補足:ソースコード
|
92
|
+
|
93
|
+
### IgaguriController.cs
|
94
|
+
|
95
|
+
```csharp
|
96
|
+
using System.Collections;
|
97
|
+
using System.Collections.Generic;
|
98
|
+
using UnityEngine;
|
99
|
+
|
100
|
+
public class IgaguriController : MonoBehaviour {
|
101
|
+
public void Shoot(Vector3 dir)
|
102
|
+
{
|
103
|
+
GetComponent<Rigidbody>().AddForce(dir);
|
104
|
+
}
|
105
|
+
|
106
|
+
void OnCollisionEnter(Collision collision)
|
107
|
+
{
|
108
|
+
GetComponent<Rigidbody>().isKinematic = true;
|
109
|
+
GetComponent<ParticleSystem>().Play();
|
110
|
+
}
|
111
|
+
|
112
|
+
// Use this for initialization
|
113
|
+
void Start () {
|
114
|
+
//Shoot(new Vector3(0, 200, 2000));
|
115
|
+
}
|
116
|
+
|
117
|
+
// Update is called once per frame
|
118
|
+
void Update () {
|
119
|
+
|
120
|
+
}
|
121
|
+
}
|
122
|
+
```
|
123
|
+
|
124
|
+
### IgaguriGenerator.cs
|
125
|
+
|
126
|
+
```csharp
|
127
|
+
using System.Collections;
|
128
|
+
using System.Collections.Generic;
|
129
|
+
using UnityEngine;
|
130
|
+
|
131
|
+
public class IgaguriGenerator : MonoBehaviour {
|
132
|
+
public GameObject igaguriPrefab;
|
133
|
+
|
134
|
+
// Use this for initialization
|
135
|
+
void Start () {
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
// Update is called once per frame
|
140
|
+
void Update () {
|
141
|
+
if (Input.GetMouseButtonDown(0))
|
142
|
+
{
|
143
|
+
GameObject igaguri = Instantiate(igaguriPrefab) as GameObject;
|
144
|
+
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
145
|
+
Vector3 worldDir = ray.direction;
|
146
|
+
//igaguri.GetComponent<IgaguriController>().Shoot(new Vector3(0, 200, 2000));
|
147
|
+
igaguri.GetComponent<IgaguriController>().Shoot(worldDir.normalized * 2000);
|
148
|
+
}
|
149
|
+
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
}
|
154
|
+
```
|
1
タイトル変更
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
Unity3DアプリをAndroidで起動すると、Unityロゴが表示された後、終了
|
1
|
+
Unity3DアプリをAndroidで起動すると、Unityロゴが表示された後、終了してしまう
|
body
CHANGED
File without changes
|