質問編集履歴
2
エラー内容を追記しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -47,4 +47,55 @@
|
|
47
47
|
|
48
48
|

|
49
49
|
|
50
|
-
ご教示よろしくお願い申し上げます。
|
50
|
+
ご教示よろしくお願い申し上げます。
|
51
|
+
|
52
|
+
12/23追記
|
53
|
+
ご指導ありがとうございます!
|
54
|
+
scriptをご教示通りに、下記に変更しました。
|
55
|
+
|
56
|
+
```C#
|
57
|
+
using System.Collections;
|
58
|
+
using System.Collections.Generic;
|
59
|
+
using UnityEngine;
|
60
|
+
using UnityEngine.UI;
|
61
|
+
|
62
|
+
public class HintButton : MonoBehaviour
|
63
|
+
{
|
64
|
+
public GameObject targetObject;
|
65
|
+
|
66
|
+
private OutlineEffect outlineEffect;
|
67
|
+
|
68
|
+
// Start is called before the first frame update
|
69
|
+
void Start()
|
70
|
+
{
|
71
|
+
outlineEffect = targetObject.GetComponent<OutlineEffect>();
|
72
|
+
}
|
73
|
+
|
74
|
+
// Update is called once per frame
|
75
|
+
void Update()
|
76
|
+
{
|
77
|
+
|
78
|
+
}
|
79
|
+
|
80
|
+
public void OnClick()
|
81
|
+
{
|
82
|
+
outlineEffect.enabled = !outlineEffect.enabled;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
```
|
87
|
+
|
88
|
+
しかしまたerrorCS0246が出てしまいました。。
|
89
|
+

|
90
|
+
|
91
|
+

|
92
|
+
|
93
|
+
どうやらOutlineEffectというnamespaceがうまく認識されていない??
|
94
|
+
ようなのですが、何か問題がありますでしょうか。。
|
95
|
+
|
96
|
+
ちなみにOutline effectは
|
97
|
+
https://baba-s.hatenablog.com/entry/2019/05/10/082000
|
98
|
+
|
99
|
+
こちらのrickomaxさんのgithubからスクリプト、シェーダーをダウンロードし、unityのプロジェクトウィンドウにドラッグ&ドロップして取得しました。
|
100
|
+
|
101
|
+
HintButtonの押下で輪郭表示のオンオフを切り替えたいという魂胆です。
|
1
outlieEffectのスペルミスを直しました(それでもうまく起動しません。。)
title
CHANGED
File without changes
|
body
CHANGED
@@ -30,14 +30,14 @@
|
|
30
30
|
|
31
31
|
void OnClick()
|
32
32
|
{
|
33
|
-
if (
|
33
|
+
if (outlineEffect.enabled = false)
|
34
34
|
{
|
35
|
-
|
35
|
+
outlineEffect.enabled = true;
|
36
36
|
}
|
37
37
|
|
38
|
-
if (
|
38
|
+
if (outlineEffect.enabled = true)
|
39
39
|
{
|
40
|
-
|
40
|
+
outlineEffect.enabled = false;
|
41
41
|
}
|
42
42
|
}
|
43
43
|
}
|