public override void SafeAwake() { base.SafeAwake(); FauxTransform fauxTransform = new FauxTransform(new Vector3(0f, 0f, 0f), Quaternion.Euler(0f, 0f, 0f), Vector3.one * 0.35f); limitSlider = AddLimits("Limit Angle", "limit angle", 45f, 45f, 180f, fauxTransform); limitSlider.UseLimitsToggle.Toggled += (value) => { steeringWheel.allowLimits = value; }; StartCoroutine(wait(false)); IEnumerator wait(bool value) { for (int i = 0; i < 3; i++) { yield return(0); } if (EnhancementEnabled == false) { limitSlider.UseLimitsToggle.IsActive = value; } yield break; } }
/// <summary> /// Creates a Block handler. /// </summary> /// <param name="bb">BlockBehaviour object.</param> public Steering(BlockBehaviour bb) : base(bb) { _sw = bb.GetComponent <SteeringWheel>(); _speedSlider = SpeedSliderField.GetValue(_sw) as MSlider; _limitsSlider = LimitsSliderField.GetValue(_sw) as MLimits; }
/// <summary> /// Creates a Block handler. /// </summary> /// <param name="bb">BlockBehaviour object.</param> public Steering(BlockBehaviour bb) : base(bb) { sw = bb.GetComponent <SteeringWheel>(); speedSlider = speedSliderField.GetValue(sw) as MSlider; limitsSlider = limitsSliderField.GetValue(sw) as MLimits; }