void OnInputReceived(Signal signal)
        {
            float val = 0.0f;

            if (Signal.TryParseFloat(signal.Args, out val))
            {
                switch (Condition)
                {
                case Conditions.GREATER:
                    if (val > Value)
                    {
                        GenerateBang();
                    }
                    break;

                case Conditions.LESSER:
                    if (val < Value)
                    {
                        GenerateBang();
                    }
                    break;

                case Conditions.EQUAL:
                    if (val == Value)
                    {
                        GenerateBang();
                    }
                    break;
                }
            }
        }
Example #2
0
 void OnSetterReceived(Signal signal)
 {
     if (signal.Args.Type == SignalTypes.FLOAT)
     {
         Value = ((SignalFloatArgs)signal.Args).Value;
     }
     else
     {
         float val = 0.0f;
         if (Signal.TryParseFloat(signal.Args, out val))
         {
             Value = val;
         }
     }
 }