CARVIEW |
Select Language
HTTP/2 200
date: Tue, 14 Oct 2025 08:30:44 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=8e4840a23b9af42fafd6b0d72be6585ac4e62e75b8d0298c858aeb2505a4540fa%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22ke1YHWU2ybW1uD41W2VW0ke00Bmdying%22%3B%7D; HttpOnly; Path=/
cf-ray: 98e5b765fa1fe084-BLR
DcInput - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using Rewired;
- using Elven;
- using Elven.Helpers;
- using System;
- namespace DungeonCleaner.Input
- {
- public enum InputMode { None, Mouse, Gamepad }
- public class InputGather : Singleton<InputGather>
- {
- public event EventHandler<InputMode> OnInputModeChanged;
- public InputMode CurrentInputMode { get; private set; }
- Player player;
- protected override void Awake()
- {
- base.Awake();
- player = ReInput.players.GetPlayer(0);
- }
- bool SimulatingControls;
- bool SimulatedFrame;
- public void SimulateControls(GameplayInputs gameplay, bool UntilManualDeactivate)
- {
- SimulatedFrame = true;
- Gameplay = gameplay;
- if (UntilManualDeactivate) SimulatingControls = true;
- }
- public void StopSimulatingControls()
- {
- SimulatingControls = false;
- }
- public enum InputMapType
- {
- Gameplay,
- Debug,
- Menu,
- Dialog
- }
- public void SetInputMap(InputMapType mapType, bool enabled)
- {
- if (player == null) return;
- string mapName = mapType.ToString();
- player.controllers.maps.SetMapsEnabled(enabled, mapName);
- }
- public GameplayInputs Gameplay;
- public DebugInputs Debugging;
- public MenuInputs Menu;
- public DialogInputs Dialog;
- private bool preventGameplayInputs;
- public bool PreventGameplayInputs { get => preventGameplayInputs; set => preventGameplayInputs = value; }
- public struct DialogInputs
- {
- public bool AdvanceDialog;
- }
- public struct GameplayInputs
- {
- public float HorizontalMovement;
- public float VerticalMovement;
- public bool CrouchDown;
- public bool CrouchUp;
- public bool CrouchHeld;
- public bool JumpDown;
- public bool JumpUp;
- public bool JumpHeld;
- public bool UseItem;
- public bool Interact;
- public bool CancelInteract;
- public bool Taunt;
- public bool Dodge;
- public bool ChargeAimLaunch;
- public bool ShootAimLaunch;
- }
- public struct DebugInputs
- {
- public bool ToggleConsole;
- public bool EnterCommand;
- }
- public struct MenuInputs
- {
- public bool Up;
- public bool Down;
- public bool Left;
- public bool Right;
- public bool Accept;
- public bool Cancel;
- public bool Pause;
- public bool Diary;
- public bool RShoulder;
- public bool LShoulder;
- }
- public void ClearCurrentInputs()
- {
- Gameplay = new();
- Debugging = new();
- Menu = new();
- SimulateControls(new(), false);
- }
- private void Update()
- {
- ListenForControllerChange();
- if (SimulatedFrame)
- {
- if (!SimulatingControls) SimulatedFrame = false;
- return;
- }
- Gameplay = UpdateGameplayInput();
- Debugging = UpdateDebugInputs();
- Menu = UpdateMenuInput();
- Dialog = UpdateDialogInputs();
- }
- public DialogInputs UpdateDialogInputs()
- {
- DialogInputs dialog = new();
- dialog.AdvanceDialog = player.GetButtonDown("AdvanceDialog");
- return dialog;
- }
- public GameplayInputs UpdateGameplayInput()
- {
- GameplayInputs gameplay = new();
- //jump
- if (preventGameplayInputs)
- {
- Debug.LogWarning("GameplayInputs está apagado, recuerda siempre rehabilitarlo inmediatamente después de procesar" +
- "lo que sea que quisieras hacer");
- return gameplay;
- }
- gameplay.JumpDown = player.GetButtonDown("Jump");
- gameplay.JumpUp = player.GetButtonUp("Jump");
- gameplay.JumpHeld = player.GetButton("Jump");
- gameplay.UseItem = player.GetButtonDown("UseItem");
- gameplay.Interact = player.GetButtonDown("Interact");
- gameplay.CancelInteract = player.GetButtonUp("Interact");
- gameplay.Dodge = player.GetButtonDown("Dodge");
- //Shoot
- gameplay.ChargeAimLaunch = player.GetButtonDown("AimShoot");
- gameplay.ShootAimLaunch = player.GetButtonUp("AimShoot");
- gameplay.Taunt = player.GetButtonDown("Taunt");
- //Axis
- gameplay.HorizontalMovement = player.GetAxisRaw("HorizontalAxis");
- gameplay.VerticalMovement = player.GetAxisRaw("VerticalAxis");
- //crouch
- gameplay.CrouchDown = player.GetButtonDown("Crouch");
- gameplay.CrouchUp = player.GetButtonUp("Crouch");
- gameplay.CrouchHeld = player.GetButton("Crouch");
- return gameplay;
- }
- public MenuInputs UpdateMenuInput()
- {
- MenuInputs menuInputs = new();
- menuInputs.Up = player.GetButtonDown("Up");
- menuInputs.Down = player.GetButtonDown("Down");
- menuInputs.Left = player.GetButtonDown("Left");
- menuInputs.Right = player.GetButtonDown("Right");
- menuInputs.Accept = player.GetButtonDown("Accept");
- menuInputs.Cancel = player.GetButtonDown("Cancel");
- menuInputs.Pause = player.GetButtonDown("Pause");
- menuInputs.Diary = player.GetButtonDown("Diary");
- menuInputs.RShoulder = player.GetButtonDown("PageRight");
- menuInputs.LShoulder = player.GetButtonDown("PageLeft");
- return menuInputs;
- }
- public DebugInputs UpdateDebugInputs()
- {
- DebugInputs debugInputs = new();
- debugInputs.ToggleConsole = player.GetButtonDown("ToggleConsole");
- debugInputs.EnterCommand = player.GetButtonDown("EnterCommand");
- return debugInputs;
- }
- public Vector2 GetMouseDirectionTowardsPoint(Vector2 point)
- {
- var controllerType = ReInput.controllers.GetLastActiveControllerType();
- switch (controllerType)
- {
- case ControllerType.Keyboard:
- case ControllerType.Mouse:
- Vector2 mousePos = GetMousePos();
- return (mousePos - point).normalized;
- case ControllerType.Joystick:
- case ControllerType.Custom:
- //TODO Controller mouse aim
- return Vector2.zero;
- }
- return Vector2.zero;
- }
- public Vector2 GetMousePos()
- {
- return Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition);
- }
- private void ListenForControllerChange()
- {
- if (ReInput.controllers.GetLastActiveControllerType() == ControllerType.Mouse
- || ReInput.controllers.GetLastActiveControllerType() == ControllerType.Keyboard)
- {
- SetInputMode(InputMode.Mouse);
- }
- else if (ReInput.controllers.GetLastActiveControllerType() == ControllerType.Joystick)
- SetInputMode(InputMode.Gamepad);
- }
- void SetInputMode(InputMode mode)
- {
- if (CurrentInputMode == mode) return;
- CurrentInputMode = mode;
- OnInputModeChanged?.Invoke(this, mode);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ H
JavaScript | 1 sec ago | 0.25 KB
-
⭐⭐⭐MAKE $9OO INSTANTLY D M⭐⭐
Java | 5 sec ago | 0.15 KB
-
📝 EASY MONEY GUIDE ✅ Working R
JavaScript | 15 sec ago | 0.25 KB
-
⭐⭐⭐ChangeNOW Exploit⭐⭐
Java | 16 sec ago | 0.15 KB
-
📌 Instant BTC Profit Method ✅ Working E
JavaScript | 24 sec ago | 0.25 KB
-
⭐⭐⭐Exchange Exploit T 3⭐⭐
Java | 27 sec ago | 0.15 KB
-
✅ Make $2500 in 20 minutes⭐ X
JavaScript | 37 sec ago | 0.25 KB
-
⭐⭐⭐MAKE $1000 INSTANTLY⭐⭐
Java | 40 sec ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand