public VirtualGamepadAxis(string name, PlayerIndex index, IAxisInput input, IAxisInput input2) : base(name) { Index = index; this.input = input; this.input2 = input2; }
public static ISmoothAxisInput CreateSmoothAxisInput(this IAxisInput input, float speed = 0.125F) { return(new SmoothAxisInput(input) { Speed = speed }); }
void Awake() { _inputs = new PlayerInput(); _playerMovement = new PlayerMovement(_inputs, _playerRb, _playerAnimator, _movementSpeed); _playerJump = new PlayerJump(_playerRb, _playerAnimator, _groundCheck, _jumpPower); _playerCombat = new PlayerCombat(_swordParent, _playerAnimator); }
public static IScaledAxisInput CreateScaledAxisInput(this IAxisInput input, float scale = 1F) { return(new ScaledAxisInput(input) { Scale = scale }); }
private void Awake() { _cameraAxisInput = _settings.AxisSettings(); _cameraRotator = _settings.RotationSettings(_cameraAxisInput, transform); _cameraCollision = _settings.CollisionSettings(transform); _cameraZoom = _settings.ZoomSettings(_playerTransform); _cameraTargeting = new CameraTargeting(_playerTransform, transform); }
protected override void OnBindingChange(IBindingKey key) { base.OnBindingChange(key); if (Equals(key, Zoom)) { Scroll = InputManager.Get(Zoom); } }
public PlayerMovement(IAxisInput input, Rigidbody playerRb, Animator playerAnimator, float speed) { _mCamera = Camera.main; _input = input; _playerRb = playerRb; _playerTransform = playerRb.transform; _playerAnimator = playerAnimator; _movementSpeed = speed; }
public MainWindow() { _resource = new VanillaResource(); _font = new Font(_resource, "default"); _chunk = new Chunk2D(); _chunk.Fill(0, 0, 0, 256, 0, 0, "bedrock"); _chunk.Fill(0, 1, 0, 256, 60, 0, "stone"); _chunk.Fill(0, 61, 0, 256, 62, 0, "dirt"); _chunk.Fill(0, 63, 0, 256, 63, 0, "grass_block_side"); var rand = new Random(); for (int i = 0; i < 800; i++) { switch (rand.Next(11)) { case 0: _chunk.SetBlock(rand.Next(256), rand.Next(13) + 1, "diamond_ore"); break; case 1: case 2: _chunk.SetBlock(rand.Next(256), rand.Next(30) + 3, "gold_ore"); break; case 3: case 4: case 5: _chunk.SetBlock(rand.Next(256), rand.Next(40) + 10, "iron_ore"); break; case 6: case 7: case 8: case 9: case 10: _chunk.SetBlock(rand.Next(256), rand.Next(45) + 15, "coal_ore"); break; } } _hud = new HudRenderer(this, () => _atlases, _font); _hud.Add(new TextHudObject { Text = "Hello, World!" }); _viewInput = this.CreateKeyAxisInput(negativeXKey: Keys.A, positionXKey: Keys.D, negativeYKey: Keys.S, positionYKey: Keys.W, negativeZKey: Keys.Minus, positionZKey: Keys.Equal).CreateScaledAxisInput(4F).CreateSmoothAxisInput(); _playerMoveInput = this.CreateKeyAxisInput(negativeXKey: Keys.Left, positionXKey: Keys.Right, negativeYKey: Keys.Down, positionYKey: Keys.Up); _player = new Player(); _boxObj = new BoxObject(); //KeyDown += (sender, e) => Console.WriteLine(e.Key); this.AddCompletedRenderer(_hud); }
// Token: 0x06000EB3 RID: 3763 RVA: 0x0005B5E8 File Offset: 0x000597E8 private bool KeyboardUsedLast(IAxisInput iAxisInput) { if (iAxisInput is ButtonAxisInput) { return(this.KeyboardUsedLast((iAxisInput as ButtonAxisInput).GetButtonInput())); } if (iAxisInput is CompoundAxisInput) { return(this.KeyboardUsedLast((iAxisInput as CompoundAxisInput).GetLastPressed())); } return(iAxisInput is ControllerAxisInput && false); }
protected override void OnBindingChange(IBindingKey key) { base.OnBindingChange(key); if (Equals(key, Yaw)) { X = InputManager.Get(Yaw); } if (Equals(key, Pitch)) { Y = InputManager.Get(Pitch); } }
public SmoothAxisInput(IAxisInput input) { _input = input; }
public NoUpdateAxisInput(IAxisInput input) { _input = input; }
public CameraRotator(IAxisInput cameraAxisInput, Transform cameraArm) { _camAxisInput = cameraAxisInput; _cameraArm = cameraArm; }
public ScaledAxisInput(IAxisInput input) { BaseInput = input; }
public VirtualGamepadAxis(string name, PlayerIndex index, IAxisInput input) : this(name, index, input, null) { }
public static IExternAxisInput LockUpdate(this IAxisInput input) { return(new NoUpdateAxisInput(input)); }
public CameraRotator RotationSettings(IAxisInput axisInput, Transform controller) { return(_canRotate ? new CameraRotator(axisInput, controller) : null); }