質問編集履歴

1

スクリプトの更新

2018/04/26 09:53

投稿

kaz2zak
kaz2zak

スコア36

test CHANGED
File without changes
test CHANGED
@@ -32,6 +32,16 @@
32
32
 
33
33
  ```C#
34
34
 
35
+
36
+
37
+ using System.Collections.Generic;
38
+
39
+
40
+
41
+ public class Switching : MonoBehaviour
42
+
43
+ {
44
+
35
45
  public void Update()
36
46
 
37
47
  {
@@ -60,4 +70,42 @@
60
70
 
61
71
  }
62
72
 
73
+
74
+
75
+ void ReDisplay()
76
+
77
+ {
78
+
79
+ List<GameObject> hideGameObject = new List<GameObject>();
80
+
81
+
82
+
83
+ hideGameObject.Add(GameObject.Find("hit.collider.gameObject"));
84
+
85
+
86
+
87
+ if (Input.GetMouseButtonDown(1))
88
+
89
+ {
90
+
91
+ hideGameObject[-1].SetActive(true);
92
+
93
+
94
+
95
+ hideGameObject.Remove(hideGameObject.count - 1); //countの定義が含まれていないとエラーメッセージが出る
96
+
97
+
98
+
99
+ }
100
+
101
+
102
+
103
+
104
+
105
+ }
106
+
107
+
108
+
109
+ ]
110
+
63
111
  ```