回答編集履歴
5
追記
test
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
[追記][StudioAres](https://teratail.com/users/StudioAres) さんのご回答を元にコードを修正しました。StudioAresさんありがとうございます。
|
2
|
+
|
3
|
+
|
4
|
+
|
1
5
|
簡単なのはこんな感じです。
|
2
6
|
|
3
7
|
|
4
修正
test
CHANGED
@@ -46,13 +46,13 @@
|
|
46
46
|
|
47
47
|
|
48
48
|
|
49
|
-
if (data != null && data.tags != null)
|
49
|
+
if (data != null && data.description != null && data.description.tags != null)
|
50
50
|
|
51
51
|
{
|
52
52
|
|
53
53
|
//Linqを使用しているので using System.Linq;がコード先頭に必要です。
|
54
54
|
|
55
|
-
var tagsStg = data.tags.Take(5).Aggregate((a, b)=>a + ", " + b );
|
55
|
+
var tagsStg = data.description.tags.Take(5).Aggregate((a, b)=>a + ", " + b );
|
56
56
|
|
57
57
|
Debug.Log (tagsStg);
|
58
58
|
|
3
var で統一
test
CHANGED
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
//Linqを使用しているので using System.Linq;がコード先頭に必要です。
|
54
54
|
|
55
|
-
|
55
|
+
var tagsStg = data.tags.Take(5).Aggregate((a, b)=>a + ", " + b );
|
56
56
|
|
57
57
|
Debug.Log (tagsStg);
|
58
58
|
|
2
追記
test
CHANGED
@@ -61,3 +61,15 @@
|
|
61
61
|
}
|
62
62
|
|
63
63
|
```
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
▼JsonUtilityはUnityのAPIです
|
68
|
+
|
69
|
+
[https://docs.unity3d.com/jp/540/ScriptReference/JsonUtility.html](https://docs.unity3d.com/jp/540/ScriptReference/JsonUtility.html)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
▼LinqはC#のAPIです
|
74
|
+
|
75
|
+
[http://ufcpp.net/study/csharp/sp3_linq.html](http://ufcpp.net/study/csharp/sp3_linq.html)
|
1
tuiki
test
CHANGED
File without changes
|