示例#1
0
 private void DetangleButton_Interacted(object sender, InputActionEventArgs e)
 {
     if (isLockedIn && !isInCooldown)
     {
         EnterCooldown();
     }
 }
示例#2
0
 private void RollerSwitch_Interacted(object sender, InputActionEventArgs e)
 {
     if (FailureEvent.InFailure)
     {
         if (FailureEvent.ApplyInputActionToFailureReset(e.InputAction))
         {
             HandleFailureResolved(FailureEvent);
         }
     }
 }
示例#3
0
 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;
     }
 }
示例#5
0
    private void UseChargeButton_Interacted(object sender, InputActionEventArgs e)
    {
        if (isLockedIn && numCharges > 0)
        {
            HandleGlobalEvent(GlobalEvent.QuantumChargeUsed, lockedInEffect);
            numCharges--;

            if (numCharges == 0)
            {
                EnterCooldown();
            }
        }
    }
示例#6
0
    protected void OnInteracted()
    {
        if (Interacted != null)
        {
            var args = new InputActionEventArgs();
            args.InputAction = new InputAction()
            {
                InputControl = this,
                InputValue   = Value
            };

            Interacted(this, args);
        }
    }
示例#7
0
    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;
    }
示例#8
0
 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
     }
 }
示例#12
0
    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;
        }
    }
示例#13
0
    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;
                }
            }
        }
    }
示例#14
0
 private void PatternSlider_Interacted(object sender, InputActionEventArgs e)
 {
     MoodRangeIndicator.TrueValue = e.InputAction.InputValue;
 }
示例#15
0
//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;
        }
    }
示例#16
0
 private void ReigniteButton_Interacted(object sender, InputActionEventArgs e)
 {
     ApplyInputActionToFailures(e.InputAction);
 }
示例#17
0
 private void TemperateSetting_Interacted(object sender, InputActionEventArgs e)
 {
     ApplyInputActionToFailures(e.InputAction);
     tempSetting = e.InputAction.InputValue;
 }
示例#18
0
 private void FillingIndicator_Interacted(object sender, InputActionEventArgs e)
 {
 }
示例#19
0
 private void PrepareNewSongButton_Interacted(object sender, InputActionEventArgs e)
 {
     nextSongPrepared  = true;
     nextSongBeatValue = Random.value;
     CheckBeatMatchQuality(nextSongBeatValue, BeatMatcherSlider.SliderValue, TrackSwitch.IsOn ? TrackOneLED : TrackTwoLED);
 }
示例#20
0
 private void BeatMatcherSlider_Interacted(object sender, InputActionEventArgs e)
 {
     CheckBeatMatchQuality(nextSongBeatValue, e.InputAction.InputValue, TrackSwitch.IsOn ? TrackOneLED : TrackTwoLED);
 }
示例#21
0
 private void MoodShuffleButton_Interacted(object sender, InputActionEventArgs e)
 {
     ShuffleMood(true);
 }
示例#22
0
 private void Heater_Interacted(object sender, InputActionEventArgs e)
 {
     ApplyInputActionToFailures(e.InputAction);
 }