-
Notifications
You must be signed in to change notification settings - Fork 0
/
KeyInputHandler.cs
150 lines (128 loc) · 6.62 KB
/
KeyInputHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace InteractiveEnable
{
public class KeyInputHandler : MonoBehaviour
{
public static KeyInputHandler Instance { get; private set; }
public event Action onUpdate;
void Awake()
{
Instance = this;
}
public void Update()
{
try
{
onUpdate.Invoke();
}catch (Exception e) { }
// try
// {
// onUpdate?.Invoke();
// // Check for specific key presses
// if (Input.GetKeyDown(Plugin.interactiveKey.Value))
// {
// Plugin.Instance.isInteractive = !Plugin.Instance.isInteractive;
// Plugin.Log.LogInfo($"isInteractive: {Plugin.Instance.isInteractive}");
// }
// if (Input.GetKeyDown(Plugin.miniGameKey.Value))
// {
// Plugin.Instance.isMiniGame = !Plugin.Instance.isMiniGame;
// foreach (var x in GameObject.FindObjectsOfType<MT_GameCnowballs>())
// {
// if (!x.play && !x.resultShow)
// x.PlayTimeStart();
// }
// Plugin.Log.LogInfo($"isMiniGame: {Plugin.Instance.isMiniGame}");
// }
// if (Input.GetKeyDown(Plugin.hardKey.Value))
// {
// //foreach (var x in GameObject.FindObjectsOfType<Location4Fight>())
// //{
// // if (x.enemyComplexity > 0)
// // x.enemyComplexity -= 1;
// // Plugin.Log.LogInfo($"enemyComplexity: {x.enemyComplexity}");
// //}
// foreach (var x in GameObject.FindObjectsOfType<Location7_GameDance>())
// {
// if (x.musicIndexPlay >= 0 && x.musicIndexPlay < 2)
// x.musicIndexPlay += 1;
// x.ChangeMusic();
// Plugin.Log.LogInfo($"musicName: {GlobalLanguage.GetString("Location 7", x.musicIndexPlay + 1)}");
// }
// }
// if (Input.GetKeyDown(Plugin.weakKey.Value))
// {
// //foreach (var x in GameObject.FindObjectsOfType<Location4Fight>())
// //{
// // x.enemyComplexity += 1;
// // Plugin.Log.LogInfo($"enemyComplexity: {x.enemyComplexity}");
// //}
// foreach (var x in GameObject.FindObjectsOfType<Location7_GameDance>())
// {
// if (x.musicIndexPlay > 0 && x.musicIndexPlay <= 2)
// x.musicIndexPlay -= 1;
// x.ChangeMusic();
// Plugin.Log.LogInfo($"musicName: {GlobalLanguage.GetString("Location 7", x.musicIndexPlay + 1)}");
// }
// }
// if (Input.GetKeyDown(Plugin.showTVHintKey.Value))
// {
// foreach (var x in GameObject.FindObjectsOfType<MinigamesTelevisionController>())
// {
// x.KeysMenuActiveTrue();
// Plugin.Log.LogInfo($"KeysMenuActiveTrue");
// }
// foreach (var x in GameObject.FindObjectsOfType<Location7_GameDance>())
// {
// x.eventFinishPlayer.Invoke();
// if (x.indexFinishMita >= 3)
// {
// GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой/Игры/Dance/Interactive DanceStart/Canvas").GetComponent<ObjectInteractive_CaseInfo>().dontDestroyAfter = true;
// GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой/Игры/Dance/Interactive DanceStart").GetComponent<ObjectInteractive>().active = true;
// }
// Plugin.Log.LogInfo($"DanceGame eventFinishPlayer");
// }
// }
//# if DEBUG
// if (Input.GetKeyDown(KeyCode.Delete))
// {
// GameObject quest4 = GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой");
// if (quest4 != null) quest4.SetActive(true);
// GameObject quest4Interactive = GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой/Интерактивы");
// if (quest4Interactive != null) quest4Interactive.SetActive(true);
// GameObject quest4HouseMain = GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой/House/Main");
// if (quest4HouseMain != null) quest4HouseMain.SetActive(true);
// GameObject actMitaKepka = GameObject.Find("World/Acts/Mita Кепка");
// if (actMitaKepka != null) actMitaKepka.SetActive(true);
// GameObject interactiveDance = GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой/Интерактивы/Interactive Dance");
// if (interactiveDance != null)
// {
// ObjectInteractive danceObjectInteractive = interactiveDance.GetComponent<ObjectInteractive>();
// if (danceObjectInteractive != null) danceObjectInteractive.active = true;
// }
// GlobalTag.player.transform.position = new Vector3(-18.63f, 0f, -1.47f);
// GameObject interactiveDoor = GameObject.Find("World/Quests/Quest4 - Проводим время с Кепкой/Интерактивы/Interactive Door");
// if (interactiveDoor != null)
// {
// ObjectInteractive doorObjectInteractive = interactiveDoor.GetComponent<ObjectInteractive>();
// if (doorObjectInteractive != null)
// {
// doorObjectInteractive.active = true;
// //doorObjectInteractive.Click();
// }
// }
// }
//# endif
// }
// catch (System.Exception ex)
// {
// Plugin.Log.LogError($"Error in Update: {ex.Message}");
// }
}
}
}