Exemplo n.º 1
0
        public void SetDirection(EDirection direction)
        {
            if (ComPort == null)
            {
                Trace.WriteLineIf(IsDebug, "No associated com port", Severity.Error);
                return;
            }
            if (!ComPort.IsOpen)
            {
                Trace.WriteLineIf(IsDebug, "Com port is not opened", Severity.Error);
                return;
            }

            try {
                Trace.WriteLineIf(IsDebug, $"Set direction to {direction.ToString()}");
                if (direction == EDirection.Clockwise)
                {
                    ComPort.Write("D");
                }
                else
                {
                    ComPort.Write("d");
                }
            } catch (Exception ex) {
                Trace.WriteLine($"Unable to set direction {direction.ToString()} on com port {ComPortName} : {ex.Message}", Severity.Error);
            }
        }
Exemplo n.º 2
0
 void HandleInputDirectionPress(EDirection direction)
 {
     if (direction != EDirection.NONE)
     {
         Debug.Log("Received valid inputdirection: " + _nextDirection.ToString());
         _currentlyQueuedDirection = direction;
     }
     else
     {
         //Debug.Log("Currently not in Input window -> invalid button press!");
     }
 }
    public override bool Detected()
    {
        if (DetectionManager.Get().IsHandSet(m_Hand) && m_CoolDownLeft <= 0.0f)
        {
            EDirection swipeDir = EDirection.eRight;

            if (IsSwiping(ref swipeDir))
            {
                if (swipeDir == m_Direction)
                {
                    _mainUIManager.SwipeGestureDetect(swipeDir.ToString());
                    m_CoolDownLeft = m_CooldownTime;
                    return(true);
                }
            }
        }

        return(false);
    }
Exemplo n.º 4
0
 public override string ToString()
 {
     return(Value.ToString());
 }