private void DetangleButton_Interacted(object sender, InputActionEventArgs e) { if (isLockedIn && !isInCooldown) { EnterCooldown(); } }
private void RollerSwitch_Interacted(object sender, InputActionEventArgs e) { if (FailureEvent.InFailure) { if (FailureEvent.ApplyInputActionToFailureReset(e.InputAction)) { HandleFailureResolved(FailureEvent); } } }
public void GetInputQueue() { if (!this.InputQueue.IsEmpty) { string inputText; this.InputQueue.TryDequeue(out inputText); InputActionEventArgs ev = new InputActionEventArgs(inputText); Server.Instance.Event.IO.OnInputAction(this, ev); this.InputAction(ev.InputText); } }
private void RefillButton_Interacted(object sender, InputActionEventArgs e) { if (FillingIndicator.IsOn) { availableSoda = 1f; } else { availableAlchohol = 1f; } }
private void UseChargeButton_Interacted(object sender, InputActionEventArgs e) { if (isLockedIn && numCharges > 0) { HandleGlobalEvent(GlobalEvent.QuantumChargeUsed, lockedInEffect); numCharges--; if (numCharges == 0) { EnterCooldown(); } } }
protected void OnInteracted() { if (Interacted != null) { var args = new InputActionEventArgs(); args.InputAction = new InputAction() { InputControl = this, InputValue = Value }; Interacted(this, args); } }
private void LockInButton_Interacted(object sender, InputActionEventArgs e) { if (isLockedIn || isInCooldown) { return; } isLockedIn = true; EffectStengthIndicator.TrueValue = EffectStengthIndicator.CurrentValue; lockedInEffect = EffectStengthIndicator.CurrentStatus; LockedInRedLED.isOn = lockedInEffect == RangeSegmentStatus.Critical; LockedInYellowLED.isOn = lockedInEffect == RangeSegmentStatus.Warning; LockedInGreenLED.isOn = lockedInEffect == RangeSegmentStatus.Nominal; numCharges = 3; }
private void DumpButton_Interacted(object sender, InputActionEventArgs e) { if (FailureEvent.InFailure) { if (FailureEvent.ApplyInputActionToFailureReset(e.InputAction)) { HandleFailureResolved(FailureEvent); TrashLevel = 0; RollerSwitch.IsOn = false; } } else { TrashLevel = 0; } }
void RunRight(object sender, InputActionEventArgs args) { if (args != null && args.Activation) { inputClient.KeyDown(SoldatInputClient.Key.D); #if UNITY_EDITOR if (debugLogWhenDataSent) { Debug.Log("Right On"); } #endif } else { inputClient.KeyUp(SoldatInputClient.Key.D); #if UNITY_EDITOR if (debugLogWhenDataSent) { Debug.Log("Right Off"); } #endif } }
void Hook(object sender, InputActionEventArgs args) { if (args != null && args.Activation) { inputClient.MouseDownA(SoldatInputClient.MouseButton.Right); #if UNITY_EDITOR if (debugLogWhenDataSent) { Debug.Log("Hook On"); } #endif } else { inputClient.MouseUp(SoldatInputClient.MouseButton.Right); #if UNITY_EDITOR if (debugLogWhenDataSent) { Debug.Log("Hook Off"); } #endif } }
void ChangeWeapon(object sender, InputActionEventArgs args) { if (args != null && args.Activation) { inputClient.MouseDownA(SoldatInputClient.MouseButton.Middle); #if UNITY_EDITOR if (debugLogWhenDataSent) { Debug.Log("ChangeWeapon On"); } #endif } else { inputClient.MouseUp(SoldatInputClient.MouseButton.Middle); #if UNITY_EDITOR if (debugLogWhenDataSent) { Debug.Log("ChangeWeapon Off"); } #endif } }
private void TrackSwitch_Interacted(object sender, InputActionEventArgs e) { var beatMatched = CheckBeatMatchQuality(nextSongBeatValue, BeatMatcherSlider.SliderValue, TrackSwitch.IsOn ? TrackOneLED : TrackTwoLED); TrackOneLED.StopBlinking(); TrackOneLED.isOn = !TrackSwitch.IsOn; TrackTwoLED.StopBlinking(); TrackTwoLED.isOn = TrackSwitch.IsOn; if (nextSongPrepared) { HandleGlobalEvent(beatMatched ? GlobalEvent.BeatMatched : GlobalEvent.BeatDropped); songDuration = MinSongTimeInSeconds + (MaxSongTimeInSeconds - MinSongTimeInSeconds) * Random.value; songDurationRemaining = songDuration; songEnded = false; nextSongPrepared = false; } else { songDurationRemaining = 0f; } }
private void Button_Interacted(object sender, InputActionEventArgs e) { if (FaultCondition.Count > 0) { for (int i = 0; i < Buttons.Length; i++) { if (sender == Buttons[i]) { if (FaultCondition.Peek() == i) { FaultCondition.Pop(); GlyphScreen.ClearGlyph(ScreenClearSide.LEFT); if (FaultCondition.Count < 1) { FaultCleared(); } } break; } } } }
private void PatternSlider_Interacted(object sender, InputActionEventArgs e) { MoodRangeIndicator.TrueValue = e.InputAction.InputValue; }
//METHODS ////////////////////////////////////////////////////////////////////////////////////////// void ExecuteInputAction(InputAction inputAction, InputActionEventArgs args) { switch (inputAction) { case InputAction.Jump: if (Jump != null) { Jump(this, args); } break; case InputAction.RunLeft: if (RunLeft != null) { RunLeft(this, args); } break; case InputAction.RunRight: if (RunRight != null) { RunRight(this, args); } break; case InputAction.Fire: if (Fire != null) { Fire(this, args); } break; case InputAction.Hook: if (Hook != null) { Hook(this, args); } break; case InputAction.ChangeWeapon: if (ChangeWeapon != null) { ChangeWeapon(this, args); } break; case InputAction.NextWeapon: if (NextWeapon != null) { NextWeapon(this, args); } break; case InputAction.PreviousWeapon: if (PreviousWeapon != null) { PreviousWeapon(this, args); } break; case InputAction.Weapon1: if (Weapon1 != null) { Weapon1(this, args); } break; case InputAction.Weapon2: if (Weapon2 != null) { Weapon2(this, args); } break; case InputAction.Weapon3: if (Weapon3 != null) { Weapon3(this, args); } break; case InputAction.Weapon4: if (Weapon4 != null) { Weapon4(this, args); } break; default: break; } }
private void ReigniteButton_Interacted(object sender, InputActionEventArgs e) { ApplyInputActionToFailures(e.InputAction); }
private void TemperateSetting_Interacted(object sender, InputActionEventArgs e) { ApplyInputActionToFailures(e.InputAction); tempSetting = e.InputAction.InputValue; }
private void FillingIndicator_Interacted(object sender, InputActionEventArgs e) { }
private void PrepareNewSongButton_Interacted(object sender, InputActionEventArgs e) { nextSongPrepared = true; nextSongBeatValue = Random.value; CheckBeatMatchQuality(nextSongBeatValue, BeatMatcherSlider.SliderValue, TrackSwitch.IsOn ? TrackOneLED : TrackTwoLED); }
private void BeatMatcherSlider_Interacted(object sender, InputActionEventArgs e) { CheckBeatMatchQuality(nextSongBeatValue, e.InputAction.InputValue, TrackSwitch.IsOn ? TrackOneLED : TrackTwoLED); }
private void MoodShuffleButton_Interacted(object sender, InputActionEventArgs e) { ShuffleMood(true); }
private void Heater_Interacted(object sender, InputActionEventArgs e) { ApplyInputActionToFailures(e.InputAction); }