回答編集履歴
2
誤字
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
ボタンをクリック出来ない原因は、fpscontrollerにあるMouse
|
1
|
+
ボタンをクリック出来ない原因は、fpscontrollerにあるMouseLook.csの以下のスクリプトが原因でした。
|
2
2
|
|
3
3
|
|
4
4
|
|
1
別の解決策があった
test
CHANGED
@@ -1,49 +1,55 @@
|
|
1
|
-
```C#
|
2
|
-
|
3
|
-
using System.Collections;
|
4
|
-
|
5
|
-
|
1
|
+
ボタンをクリック出来ない原因は、fpscontrollerにあるMouseClick.csの以下のスクリプトが原因でした。
|
6
|
-
|
7
|
-
using UnityEngine;
|
8
2
|
|
9
3
|
|
10
4
|
|
11
|
-
|
5
|
+
```C#
|
12
6
|
|
7
|
+
private void InternalLockUpdate()
|
8
|
+
|
13
|
-
{
|
9
|
+
{
|
10
|
+
|
11
|
+
if (Input.GetKeyUp(KeyCode.Escape))
|
12
|
+
|
13
|
+
{
|
14
|
+
|
15
|
+
m_cursorIsLocked = false;
|
16
|
+
|
17
|
+
}
|
18
|
+
|
19
|
+
else if (Input.GetMouseButtonUp(0))
|
20
|
+
|
21
|
+
{
|
22
|
+
|
23
|
+
m_cursorIsLocked = true;
|
24
|
+
|
25
|
+
}
|
14
26
|
|
15
27
|
|
16
28
|
|
17
|
-
public GameObject InfoPanel;
|
18
29
|
|
19
30
|
|
31
|
+
if (m_cursorIsLocked)
|
20
32
|
|
21
|
-
|
33
|
+
{
|
22
34
|
|
23
|
-
|
35
|
+
Cursor.lockState = CursorLockMode.Locked;
|
24
36
|
|
25
|
-
|
37
|
+
Cursor.visible = false;
|
26
38
|
|
27
|
-
}
|
39
|
+
}
|
28
40
|
|
41
|
+
else if (!m_cursorIsLocked)
|
29
42
|
|
43
|
+
{
|
30
44
|
|
31
|
-
|
45
|
+
Cursor.lockState = CursorLockMode.None;
|
32
46
|
|
33
|
-
|
47
|
+
Cursor.visible = true;
|
34
48
|
|
35
|
-
if (Input.GetMouseButtonDown(0))
|
36
|
-
|
37
|
-
{
|
38
|
-
|
39
|
-
Click001();
|
40
|
-
|
41
|
-
}
|
49
|
+
}
|
42
|
-
|
43
|
-
}
|
44
|
-
|
45
|
-
}
|
46
50
|
|
47
51
|
```
|
48
52
|
|
49
|
-
と
|
53
|
+
左クリックを押すと画面中央にマウスカーソルが固定されてしまい、クリック出来なかったようです。
|
54
|
+
|
55
|
+
なので、右クリックを押したときに「m_cursorIsLocked = true;」にしたら、普通にクリック出来るようになりました。
|