質問編集履歴

2

エラー内容を追記しました。

2020/12/23 02:29

投稿

911RSR
911RSR

スコア13

test CHANGED
File without changes
test CHANGED
@@ -97,3 +97,105 @@
97
97
 
98
98
 
99
99
  ご教示よろしくお願い申し上げます。
100
+
101
+
102
+
103
+ 12/23追記
104
+
105
+ ご指導ありがとうございます!
106
+
107
+ scriptをご教示通りに、下記に変更しました。
108
+
109
+
110
+
111
+ ```C#
112
+
113
+ using System.Collections;
114
+
115
+ using System.Collections.Generic;
116
+
117
+ using UnityEngine;
118
+
119
+ using UnityEngine.UI;
120
+
121
+
122
+
123
+ public class HintButton : MonoBehaviour
124
+
125
+ {
126
+
127
+ public GameObject targetObject;
128
+
129
+
130
+
131
+ private OutlineEffect outlineEffect;
132
+
133
+
134
+
135
+ // Start is called before the first frame update
136
+
137
+ void Start()
138
+
139
+ {
140
+
141
+ outlineEffect = targetObject.GetComponent<OutlineEffect>();
142
+
143
+ }
144
+
145
+
146
+
147
+ // Update is called once per frame
148
+
149
+ void Update()
150
+
151
+ {
152
+
153
+
154
+
155
+ }
156
+
157
+
158
+
159
+ public void OnClick()
160
+
161
+ {
162
+
163
+ outlineEffect.enabled = !outlineEffect.enabled;
164
+
165
+ }
166
+
167
+ }
168
+
169
+
170
+
171
+ ```
172
+
173
+
174
+
175
+ しかしまたerrorCS0246が出てしまいました。。
176
+
177
+ ![エラーメッセージ](15a3327bae30fae11d629acebbe9ea97.jpeg)
178
+
179
+
180
+
181
+ ![VisualStudio](80660f500a01beb9a40904f292c3bfe1.jpeg)
182
+
183
+
184
+
185
+ どうやらOutlineEffectというnamespaceがうまく認識されていない??
186
+
187
+ ようなのですが、何か問題がありますでしょうか。。
188
+
189
+
190
+
191
+ ちなみにOutline effectは
192
+
193
+ https://baba-s.hatenablog.com/entry/2019/05/10/082000
194
+
195
+
196
+
197
+ こちらのrickomaxさんのgithubからスクリプト、シェーダーをダウンロードし、unityのプロジェクトウィンドウにドラッグ&ドロップして取得しました。
198
+
199
+
200
+
201
+ HintButtonの押下で輪郭表示のオンオフを切り替えたいという魂胆です。

1

outlieEffectのスペルミスを直しました(それでもうまく起動しません。。)

2020/12/23 02:29

投稿

911RSR
911RSR

スコア13

test CHANGED
File without changes
test CHANGED
@@ -62,21 +62,21 @@
62
62
 
63
63
  {
64
64
 
65
- if (outlieEffect.enabled = false)
65
+ if (outlineEffect.enabled = false)
66
66
 
67
67
  {
68
68
 
69
- outlieEffect.enabled = true;
69
+ outlineEffect.enabled = true;
70
70
 
71
71
  }
72
72
 
73
73
 
74
74
 
75
- if (outlieEffect.enabled = true)
75
+ if (outlineEffect.enabled = true)
76
76
 
77
77
  {
78
78
 
79
- outlieEffect.enabled = false;
79
+ outlineEffect.enabled = false;
80
80
 
81
81
  }
82
82