質問編集履歴
1
画像の追加、コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,3 +9,57 @@
|
|
9
9
|
以前はステータス欄にも2回目以降表示されていたと思うのですがいつの間にか変化しなくなっていました。何卒ご教授ください。
|
10
10
|
|
11
11
|
「Debug Log 2回目以降 表示されない」などで検索しても同様のケースが見つからず困っております。
|
12
|
+
|
13
|
+

|
14
|
+
画像のコンソール欄は問題なく動いておりますが、下のステータス欄は最初に1回ずつは表示されますがその後は変更されない状況です。
|
15
|
+
|
16
|
+
using System.Collections;
|
17
|
+
using System.Collections.Generic;
|
18
|
+
using UnityEngine;
|
19
|
+
|
20
|
+
public class StateController : MonoBehaviour
|
21
|
+
{
|
22
|
+
public enum StateType
|
23
|
+
{
|
24
|
+
None = 0,
|
25
|
+
Title,
|
26
|
+
Menu,
|
27
|
+
}
|
28
|
+
|
29
|
+
public StateType CurrentState;
|
30
|
+
public StateBase State;
|
31
|
+
public ConfigState StateA ;
|
32
|
+
public TitleState StateB;
|
33
|
+
|
34
|
+
// Start is called before the first frame update
|
35
|
+
void Start()
|
36
|
+
{
|
37
|
+
CurrentState = StateType.None;
|
38
|
+
|
39
|
+
StateA = gameObject.AddComponent<ConfigState>();
|
40
|
+
StateB = gameObject.AddComponent<TitleState>();
|
41
|
+
State = StateA;
|
42
|
+
}
|
43
|
+
|
44
|
+
// Update is called once per frame
|
45
|
+
void Update()
|
46
|
+
{
|
47
|
+
;
|
48
|
+
|
49
|
+
//���N���b�N���t����
|
50
|
+
if (Input.GetMouseButtonDown(0))
|
51
|
+
State.talk();
|
52
|
+
//Debug.Log("Pressed primary button.");
|
53
|
+
|
54
|
+
|
55
|
+
//�E�N���b�N���t����
|
56
|
+
if (Input.GetMouseButtonDown(1))
|
57
|
+
StateB.talk();
|
58
|
+
//Debug.Log("Pressed secondary button.");
|
59
|
+
|
60
|
+
//�~�h���N���b�N���t����
|
61
|
+
if (Input.GetMouseButtonDown(2))
|
62
|
+
Debug.Log("Pressed middle click.");
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|