From a1950a7b7a496a386b4a93476da81ac4fa35f63c Mon Sep 17 00:00:00 2001 From: teascade Date: Wed, 7 Aug 2019 22:31:43 +0300 Subject: [PATCH] Add GodMode and bind F10 to it --- Assets/Scripts/Player/PlayerFun.cs | 16 +++++++++++++++- ProjectSettings/InputManager.asset | 6 +++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Player/PlayerFun.cs b/Assets/Scripts/Player/PlayerFun.cs index d95c010..b690433 100644 --- a/Assets/Scripts/Player/PlayerFun.cs +++ b/Assets/Scripts/Player/PlayerFun.cs @@ -20,6 +20,8 @@ namespace Saltosion.OneWeapon { public float CurrentFun { private set; get; } public bool DebugAdd10Fun = false; + public bool DebugSubtract10Fun = false; + public bool GodMode = false; public float CurrentDamageBoost { private set; get; } @@ -28,16 +30,28 @@ namespace Saltosion.OneWeapon { } void Update() { + // God mode hotkey + if (Input.GetButtonUp("GodModeToggle")) { + GodMode = !GodMode; + } + float Delta = FunDegradeSpeed * Time.deltaTime; if (!Player.IsMoving) { Delta *= StandingStillMultiplier; } - float NewFun = CurrentFun - Delta; + float NewFun = CurrentFun; + if (!GodMode) { + NewFun -= Delta; + } if (DebugAdd10Fun) { NewFun += 10; DebugAdd10Fun = false; } + if (DebugSubtract10Fun) { + NewFun -= 10; + DebugSubtract10Fun = false; + } CurrentFun = Mathf.Clamp(NewFun, 0, MaxFun); diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index 0ccfa20..8c884ae 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -70,13 +70,13 @@ InputManager: axis: 0 joyNum: 0 - serializedVersion: 3 - m_Name: Fire3 + m_Name: GodModeToggle descriptiveName: descriptiveNegativeName: negativeButton: - positiveButton: left shift + positiveButton: f10 altNegativeButton: - altPositiveButton: mouse 2 + altPositiveButton: gravity: 1000 dead: 0.001 sensitivity: 1000