質問編集履歴

1

コード 情報の追加、参考のSSの追加

2020/10/21 08:01

投稿

beginner_F
beginner_F

スコア12

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,315 @@
15
15
 
16
16
 
17
17
  Can't remove SpriteRenderer because PlaceData (Script), PlaceData (Script), PlaceData (Script), PlaceData (Script), PlaceData (Script) depends on it
18
+
19
+
20
+
21
+ ![イメージ説明](9c52446c72a7079aee89e8f5985904cb.png)
22
+
23
+
24
+
25
+ ```ここに言語を入力
26
+
27
+ using System.Collections;
28
+
29
+ using System.Collections.Generic;
30
+
31
+ using UnityEngine;
32
+
33
+
34
+
35
+ public class PlaceData : MonoBehaviour
36
+
37
+ {
38
+
39
+ public string Name = "Name";
40
+
41
+ public int Durable = 1000;// 耐久値
42
+
43
+
44
+
45
+ //
46
+
47
+ public int Security = 10;
48
+
49
+
50
+
51
+ // ビジュアルマップ
52
+
53
+ public int[] MapSizeXY = new int[] { 10, 10};
54
+
55
+ public GameObject[][] VmapCharaDate;
56
+
57
+ public GameObject[][] MapFloorDate;
58
+
59
+ public GameObject VmapObj;
60
+
61
+ public bool ShowMap = false;
62
+
63
+
64
+
65
+ public int AllList_ID;
66
+
67
+ public int PiaceID;
68
+
69
+
70
+
71
+ public int DeepNum = 3;
72
+
73
+ public int PiaceNum = 5;
74
+
75
+
76
+
77
+ public int SetNeedDeep = 1;
78
+
79
+
80
+
81
+ public bool Master = false;
82
+
83
+
84
+
85
+ public bool Building = false;
86
+
87
+ public bool BuildingNeed = false;
88
+
89
+ public bool BuildingCant = false;
90
+
91
+
92
+
93
+ public bool Artificial = false;
94
+
95
+ public bool ArtificialNeed = false;
96
+
97
+ public bool ArtificialCant = false;
98
+
99
+
100
+
101
+ // インスタンス
102
+
103
+ public PlaceData ParentPD;
104
+
105
+ public GameObject[] PiaceList;
106
+
107
+ public GameObject[][] PiaceMap;
108
+
109
+ public GameObject placeSelectButton;
110
+
111
+
112
+
113
+ public int MaxStayChara = 5;
114
+
115
+ public GameObject[] StayCharaList;
116
+
117
+
118
+
119
+ // 落ちているアイテム
120
+
121
+ public GameObject[] ItemList;
122
+
123
+
124
+
125
+ // 基底から移植
126
+
127
+ VisualMapDirector VMD;
128
+
129
+ public void GetVisualMapDiretor()
130
+
131
+ {
132
+
133
+ GameObject go = GameObject.Find("Director");
134
+
135
+ VMD = go.GetComponent<VisualMapDirector>();
136
+
137
+ }
138
+
139
+
140
+
141
+ public static GameObject[][] Return_Jagge_GameObj(int[] Size)
142
+
143
+ {
144
+
145
+ GameObject[][] Array = new GameObject[Size[0]][];
146
+
147
+ for (int i = 0; i < Array.Length; i++)
148
+
149
+ {
150
+
151
+ Array[i] = new GameObject[Size[1]];
152
+
153
+ }
154
+
155
+ return Array;
156
+
157
+ }
158
+
159
+
160
+
161
+ // スタート**********************************************************************
162
+
163
+ void Start()
164
+
165
+ {
166
+
167
+ // ビジュアルマップ データ
168
+
169
+ GetVisualMapDiretor();
170
+
171
+
172
+
173
+ VmapCharaDate = Return_Jagge_GameObj(MapSizeXY);
174
+
175
+ MapFloorDate = Return_Jagge_GameObj(MapSizeXY);
176
+
177
+
178
+
179
+ // キャラリストの準備
180
+
181
+ StayCharaList = new GameObject[D.AllMapCharaList.Length];
182
+
183
+ }
184
+
185
+
186
+
187
+ // クラス関数**********************************************************************
188
+
189
+
190
+
191
+ public int CountStayChara()// マップのキャラクターの数を返す。
192
+
193
+ {
194
+
195
+ int Count = 0;
196
+
197
+ for (int i = 0; i < StayCharaList.Length; i++)
198
+
199
+ {
200
+
201
+ if (StayCharaList[i] != null)
202
+
203
+ {
204
+
205
+ Count++;
206
+
207
+ }
208
+
209
+ }
210
+
211
+ Debug.Log("マップに滞在中のキャラクター数_" + Count);
212
+
213
+ return Count;
214
+
215
+ }
216
+
217
+
218
+
219
+ public int DeepOfMax(GameObject[] List)
220
+
221
+ {
222
+
223
+ int Deep = 0;
224
+
225
+ for (; Deep < List.Length; Deep++)
226
+
227
+ {
228
+
229
+ if (List[Deep] == null)
230
+
231
+ {
232
+
233
+ break;
234
+
235
+ }
236
+
237
+ }
238
+
239
+ return Deep;
240
+
241
+ }
242
+
243
+ public int DeepOfMax()
244
+
245
+ {
246
+
247
+ int Deep = 0;
248
+
249
+ for (; Deep < PiaceList.Length; Deep++)
250
+
251
+ {
252
+
253
+ if (PiaceList[Deep] == null)
254
+
255
+ {
256
+
257
+ break;
258
+
259
+ }
260
+
261
+ }
262
+
263
+ Deep--;
264
+
265
+ Debug.Log(Name + "DeepOfMax_ReTurn" + Deep);
266
+
267
+ return Deep;
268
+
269
+ }
270
+
271
+
272
+
273
+ public bool CharaListSerch()
274
+
275
+ {
276
+
277
+ for (int i = 0; i < StayCharaList.Length; i++)
278
+
279
+ {
280
+
281
+ if (StayCharaList[i] != null)
282
+
283
+ {
284
+
285
+ if (!StayCharaList[i].GetComponent<ADVCharaState>().Hiden)
286
+
287
+ {
288
+
289
+ return true;
290
+
291
+ }
292
+
293
+ }
294
+
295
+ }
296
+
297
+ return false;
298
+
299
+ }
300
+
301
+
302
+
303
+ public bool PlaceExistenceCheck()
304
+
305
+ {
306
+
307
+ for (int i = 0; i < PiaceList.Length; i++)
308
+
309
+ {
310
+
311
+ if (PiaceList[i] != null)
312
+
313
+ {
314
+
315
+ return true;
316
+
317
+ }
318
+
319
+ }
320
+
321
+ return false;
322
+
323
+ }
324
+
325
+ }
326
+
327
+
328
+
329
+ ```