public TouchWheelContainer()
        {
            Name             = "TouchWheelContainer";
            RelativeSizeAxes = Axes.Both;
            Height           = 1;
            Width            = 0.5f;

            AlwaysPresent = true;
            Alpha         = 1;

            Child = Wheel = new TouchWheel();

            BorderThickness = 0;
            EdgeEffect      = new EdgeEffectParameters();
        }
Example #2
0
    /// <summary>
    /// Enable or disable buttons based the template config
    /// </summary>
    void EnableDisableButtons(bool bThrottle, bool bBreak, bool bSteerLeft, bool bSteerRight, bool bSteerWheel, bool bShiftUp, bool bShiftDown)
    {
        //if (Throttle != null) Throttle.gameObject.SetActiveRecursively(bThrottle);
        if (Throttle != null)
        {
            TouchButton tbThrottle = Throttle as TouchButton;
            tbThrottle.gameObject.SetActiveRecursively(bThrottle);
        }
        if (Brake != null)
        {
            TouchButton tbBrake = Brake as TouchButton;
            tbBrake.gameObject.SetActiveRecursively(bBreak);
        }
        if (SteerLeft != null)
        {
            TouchButton tbSteerLeft = SteerLeft as TouchButton;
            tbSteerLeft.gameObject.SetActiveRecursively(bSteerLeft);
        }
        if (SteerRight != null)
        {
            TouchButton tbSteerRight = SteerRight as TouchButton;
            tbSteerRight.gameObject.SetActiveRecursively(bSteerRight);
        }
        if (ShiftUp != null)
        {
            TouchButton tbShiftUp = ShiftUp as TouchButton;
            tbShiftUp.gameObject.SetActiveRecursively(bShiftUp);
        }
        if (ShiftDown != null)
        {
            TouchButton tbShiftDown = ShiftDown as TouchButton;
            tbShiftDown.gameObject.SetActiveRecursively(bShiftDown);
        }
        if (Wheel != null)
        {
            TouchWheel twWheel = Wheel as TouchWheel;
            twWheel.gameObject.SetActiveRecursively(bSteerWheel);
        }

        //if (Brake != null) Brake.gameObject.SetActiveRecursively(bBreak);
        //if (SteerLeft != null) SteerLeft.gameObject.SetActiveRecursively(bSteerLeft);
        //if (SteerRight != null) SteerRight.gameObject.SetActiveRecursively(bSteerRight);
        //if (Wheel != null) Wheel.gameObject.SetActiveRecursively(bSteerWheel);
        //if (ShiftUp != null) ShiftUp.gameObject.SetActiveRecursively(bShiftUp);
        //if (ShiftDown != null) ShiftDown.gameObject.SetActiveRecursively(bShiftDown);
    }