Fixed a few issues

dev-hazim
Hazim Bin Ijaz 1 month ago
parent 0e53543d91
commit e1b8487bf9

@ -146,6 +146,10 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects
DontDestroyOnLoad(gameObject);
Instance = this;
#if UNITY_ANDROID|| UNITY_IOS
Screen.sleepTimeout = SleepTimeout.NeverSleep;
#endif
}
void BuildActionIDs()

@ -547,7 +547,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
bool SwapKeyPressed = false;
private void HandleSwapInput()
{
if (Input.GetKeyDown(KeyCode.Q) || CnInputManager.GetButtonDown("Swap"))
if (Input.GetKeyDown(KeyCode.Q))
{
if (CanActivateSwapMode())
{
@ -568,8 +568,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
private void HandleAbilityInput()
{
//if (Input.GetKeyDown(KeyCode.E)) // Dash'N'Crash
if (CnInputManager.GetButtonDown(GameDataSource.Instance.DashNCrashAbilityKey) || Input.GetKeyDown(KeyCode.E)) // Dash'N'Crash
if (Input.GetKeyDown(KeyCode.E)) // Dash'N'Crash
{
if (!m_ServerCharacter.IsCrow)
{
@ -578,7 +577,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
}
ActivateAbilityIfAllowed(GameDataSource.Instance.DashNCrashAbilityKey, "Abilities are only for crow");
}
if (CnInputManager.GetButtonDown(GameDataSource.Instance.FreezeThrowAbilityKey) || Input.GetKeyDown(KeyCode.R)) // Freeze Throw
if (Input.GetKeyDown(KeyCode.R)) // Freeze Throw
{
if (m_ServerCharacter.IsCrow)
{
@ -587,11 +586,11 @@ namespace Unity.BossRoom.Gameplay.UserInput
}
ActivateAbilityIfAllowed(GameDataSource.Instance.FreezeThrowAbilityKey);
}
if (CnInputManager.GetButtonDown(GameDataSource.Instance.VectorWallAbilityKey) || Input.GetKeyDown(KeyCode.F)) // Vector Wall
if (Input.GetKeyDown(KeyCode.F)) // Vector Wall
{
ActivateAbilityIfAllowed(GameDataSource.Instance.VectorWallAbilityKey);
}
if (CnInputManager.GetButtonDown(GameDataSource.Instance.TheExecutionerKey) || Input.GetKeyDown(KeyCode.C)) // The Executioner
if (Input.GetKeyDown(KeyCode.C)) // The Executioner
{
if (m_ServerCharacter.IsCrow)
{
@ -600,7 +599,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
}
ActivateAbilityIfAllowed(GameDataSource.Instance.TheExecutionerKey);
}
if (CnInputManager.GetButtonDown(GameDataSource.Instance.CrowsForesightKey) || Input.GetKeyDown(KeyCode.V)) // Crow's Foresight
if (Input.GetKeyDown(KeyCode.V)) // Crow's Foresight
{
if (!m_ServerCharacter.IsCrow)
{
@ -613,7 +612,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
private void HandleSprint()
{
if (m_ServerCharacter.IsCrow) return;
if (CnInputManager.GetButtonDown("Sprint") || Input.GetKey(KeyCode.LeftShift))
if (Input.GetKey(KeyCode.LeftShift))
{
float staminaCost = 50f * Time.deltaTime;
@ -621,6 +620,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
{
if (!isSprinting)
{
isSprinting = true;
StartSprintServerRPC();
}
}
@ -628,10 +628,12 @@ namespace Unity.BossRoom.Gameplay.UserInput
{
StopSprintServerRPC();
staminaManager.StopConsuming(); // Allows regen after delay
isSprinting = false;
}
}
else if (isSprinting) // Sprint key released
{
isSprinting = false;
StopSprintServerRPC();
staminaManager.StopConsuming(); // Allows regen after delay
}
@ -816,7 +818,7 @@ namespace Unity.BossRoom.Gameplay.UserInput
private void HandleMobileSprint()
{
//if (m_ServerCharacter.IsCrow) return;
if (m_ServerCharacter.IsCrow) return;
if (CnInputManager.GetButton(GameDataSource.Instance.SprintButtonKey))
{
float staminaCost = 50f * Time.deltaTime;

Loading…
Cancel
Save