protected override void OnRuntimeEnable() { base.OnRuntimeEnable(); _controllerHelper = Target.GetType().GetField("_helper", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(Target) as IControllerHelper; _mousePosition = _controllerHelper.GetType().GetField("_mousePosition", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_controllerHelper) as MousePosition; _mouseRotation = _controllerHelper.GetType().GetField("_mouseRotation", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_controllerHelper) as MouseRotation; if (_mousePosition && _mouseRotation) { _positionLimitCenter.Set((_mousePosition.XMaxLimit - _mousePosition.XMinLimit) / 2 + _mousePosition.XMinLimit , (_mousePosition.YMaxLimit - _mousePosition.YMinLimit) / 2 + _mousePosition.YMinLimit , (_mousePosition.ZMaxLimit - _mousePosition.ZMinLimit) / 2 + _mousePosition.ZMinLimit); _positionLimitSize.Set(_mousePosition.XMaxLimit - _mousePosition.XMinLimit , _mousePosition.YMaxLimit - _mousePosition.YMinLimit , _mousePosition.ZMaxLimit - _mousePosition.ZMinLimit); _limitMin.Set(_mousePosition.XMinLimit, _mousePosition.YMinLimit, _mousePosition.ZMinLimit); _limitMax.Set(_mousePosition.XMaxLimit, _mousePosition.YMaxLimit, _mousePosition.ZMaxLimit); } }