回答編集履歴

1

コード修正案を追記

2020/12/23 03:23

投稿

Bongo
Bongo

スコア10807

test CHANGED
@@ -127,3 +127,85 @@
127
127
 
128
128
 
129
129
  エラーメッセージにはエラー番号以外にも、エラーについての説明やエラーが発生しているファイル名、行番号だとかが記載されているかと思います。それらをご提示いただけると手がかりになるかもしれません。
130
+
131
+
132
+
133
+ ##追記
134
+
135
+
136
+
137
+ [globaloutline/OutlineEffect.cs at master · rickomax/globaloutline · GitHub](https://github.com/rickomax/globaloutline/blob/master/Assets/GlobalOutline/Scripts/OutlineEffect.cs)をご覧いただきたいのですが、`OutlineEffect`は`GlobalOutline`というネームスペースにあるようです。
138
+
139
+ ですので、
140
+
141
+
142
+
143
+ ```C#
144
+
145
+ using System.Collections;
146
+
147
+ using System.Collections.Generic;
148
+
149
+ using UnityEngine;
150
+
151
+ using UnityEngine.UI;
152
+
153
+
154
+
155
+ // usingディレクティブを追加
156
+
157
+ using GlobalOutline;
158
+
159
+
160
+
161
+ public class HintButton : MonoBehaviour
162
+
163
+ {
164
+
165
+ public GameObject targetObject;
166
+
167
+
168
+
169
+ private OutlineEffect outlineEffect;
170
+
171
+
172
+
173
+ // Start is called before the first frame update
174
+
175
+ void Start()
176
+
177
+ {
178
+
179
+ outlineEffect = targetObject.GetComponent<OutlineEffect>();
180
+
181
+ }
182
+
183
+
184
+
185
+ // Update is called once per frame
186
+
187
+ void Update()
188
+
189
+ {
190
+
191
+
192
+
193
+ }
194
+
195
+
196
+
197
+ public void OnClick()
198
+
199
+ {
200
+
201
+ outlineEffect.enabled = !outlineEffect.enabled;
202
+
203
+ }
204
+
205
+ }
206
+
207
+ ```
208
+
209
+
210
+
211
+ ならばどうでしょうか。