public ImportExportScreen(EmbodyContext context, IEmbody embody, IWorldScaleModule worldScale, ISnugModule snug) : base(context) { _embody = embody; _worldScale = worldScale; _snug = snug; }
public MeasureHandsPaddingStep(EmbodyContext context) : base(context) { _head = context.containingAtom.rigidbodies.First(fc => fc.name == "head"); _leftHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "lHandControl"); _rightHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "rHandControl"); }
public MeasureArmsAtRestStep(EmbodyContext context, ControllerAnchorPoint anchor) : base(context) { _anchor = anchor; _leftHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "lHandControl"); _rightHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "rHandControl"); _leftHandMotion = context.trackers.motionControls.First(mc => mc.name == MotionControlNames.LeftHand); _rightHandMotion = context.trackers.motionControls.First(mc => mc.name == MotionControlNames.RightHand); }
public MeasureAnchorWidthStep(EmbodyContext context, ControllerAnchorPoint anchor, float handRotate, bool ignoreDepth = false) : base(context) { _anchor = anchor; _handRotate = handRotate; _ignoreDepth = ignoreDepth; _leftHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "lHandControl"); _rightHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "rHandControl"); }
private T CreateModule <T>(EmbodyContext context) where T : MonoBehaviour, IEmbodyModule { var module = _modules.AddComponent <T>(); module.enabled = module.alwaysEnabled; module.context = context; module.activeJSON = activeJSON; return(module); }
public static void MarkForRecord(EmbodyContext context) { foreach (var controller in context.plugin.containingAtom.freeControllers.Where(fc => fc.possessed)) { var mac = controller.GetComponent <MotionAnimationControl>(); mac.ClearAnimation(); mac.armedForRecord = true; } }
private static IEnumerator WaitForRecordComplete(EmbodyContext context) { while (!string.IsNullOrEmpty(SuperController.singleton.helpText)) { yield return(0); } context.motionAnimationMaster.StopPlayback(); context.motionAnimationMaster.ResetAnimation(); }
public MeasureAnchorDepthAndOffsetStep(EmbodyContext context, ControllerAnchorPoint anchor, float handRotate) : base(context) { _anchor = anchor; _handRotate = handRotate; _leftHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "lHandControl"); _rightHandControl = context.containingAtom.freeControllers.First(fc => fc.name == "rHandControl"); _headControl = context.containingAtom.freeControllers.First(fc => fc.name == "headControl"); _chestControl = context.containingAtom.freeControllers.First(fc => fc.name == "chestControl"); }
private T CreateModule <T>(EmbodyContext context) where T : MonoBehaviour, IEmbodyModule { var module = _modules.AddComponent <T>(); module.enabled = false; module.context = context; module.InitStorables(); module.activeJSON = activeJSON; _modulesList.Add(module); return(module); }
public static void ApplyPossessionSpring(EmbodyContext context) { foreach (var controller in context.trackers.motionControls .Where(mc => mc.enabled && mc.mappedControllerName != null) .Select(mc => context.containingAtom.freeControllers.FirstOrDefault(fc => fc.name == mc.mappedControllerName)) .Where(fc => fc != null)) { controller.RBHoldPositionSpring = SuperController.singleton.possessPositionSpring; controller.RBHoldRotationSpring = SuperController.singleton.possessRotationSpring; } }
public static void ResetToDefaults(EmbodyContext context) { context.embody.activeJSON.val = false; context.automation.ResetToDefault(); context.worldScale.ResetToDefault(); context.hideGeometry.ResetToDefault(); context.offsetCamera.ResetToDefault(); context.passenger.ResetToDefault(); context.trackers.ResetToDefault(); context.snug.ResetToDefault(); context.eyeTarget.ResetToDefault(); }
// ReSharper disable once Unity.NoNullPropagation Unity.NoNullCoalescing public static void StartRecord(EmbodyContext context) { context.embody.activeJSON.val = true; context.motionAnimationMaster.StopPlayback(); context.motionAnimationMaster.ResetAnimation(); MarkForRecord(context); SuperController.singleton.SelectModeAnimationRecord(); SuperController.singleton.StartCoroutine(WaitForRecordComplete(context)); }
public static void DisableUntrackedControls(EmbodyContext context) { foreach (var control in context.containingAtom.freeControllers.Where(fc => fc.name.EndsWith("Control"))) { if (control.name == "eyeTargetControl") { continue; } if (context.trackers.motionControls.Any(mc => mc.mappedControllerName == control.name)) { control.deactivateOtherControlsOnPossess = false; } else { control.currentPositionState = FreeControllerV3.PositionState.Off; control.currentRotationState = FreeControllerV3.RotationState.Off; } } }
public ImportExportScreen(EmbodyContext context) : base(context) { _storage = new Storage(context); }
public HideGeometrySettingsScreen(EmbodyContext context, IHideGeometryModule hideGeometry) : base(context) { _hideGeometry = hideGeometry; }
public TrackerAutoSetup(EmbodyContext context) { _context = context; }
public ProfilesScreen(EmbodyContext context) : base(context) { _storage = new Storage(context); }
public ExperimentalAskViveTrackersStep(EmbodyContext context, List <IWizardStep> steps) : base(context) { _steps = steps; }
public PassengerSettingsScreen(EmbodyContext context, IPassengerModule passenger) : base(context) { _passenger = passenger; }
public RecordViveTrackersStep(EmbodyContext context) : base(context) { }
public EyeTargetSettingsScreen(EmbodyContext context, IEyeTargetModule eyeTarget) : base(context) { _eyeTarget = eyeTarget; }
public WizardScreen(EmbodyContext context, IWizard wizard) : base(context) { _wizard = wizard; }
public MainScreen(EmbodyContext context, IEmbodyModule[] modules) : base(context) { _modules = modules; }
public MakeDefaultsStep(EmbodyContext context) : base(context) { }
public TrackersSettingsScreen(EmbodyContext context, ITrackersModule trackers) : base(context) { _trackers = trackers; _trackerAutoSetup = new TrackerAutoSetup(context); }
public override void Init() { try { activeJSON = new JSONStorableBool("Active", false) { isStorable = false }; _modules = new GameObject(); _modules.transform.SetParent(transform, false); _modules.SetActive(false); _context = new EmbodyContext(this, this); _context.Initialize(); var automationModule = CreateModule <AutomationModule>(_context); var worldScaleModule = CreateModule <WorldScaleModule>(_context); var hideGeometryModule = CreateModule <HideGeometryModule>(_context); var offsetCameraModule = CreateModule <OffsetCameraModule>(_context); var passengerModule = CreateModule <PassengerModule>(_context); var trackersModule = CreateModule <TrackersModule>(_context); var snugModule = CreateModule <SnugModule>(_context); var eyeTargetModule = CreateModule <EyeTargetModule>(_context); var wizardModule = CreateModule <WizardModule>(_context); automationModule.embody = this; trackersModule.snug = snugModule; trackersModule.passenger = passengerModule; snugModule.trackers = trackersModule; wizardModule.embody = this; wizardModule.passenger = passengerModule; wizardModule.worldScale = worldScaleModule; wizardModule.snug = snugModule; _modules.SetActive(true); _screensManager = new ScreensManager(); _screensManager.Add(MainScreen.ScreenName, new MainScreen(_context, _modules.GetComponents <IEmbodyModule>(), wizardModule)); _screensManager.Add(TrackersSettingsScreen.ScreenName, new TrackersSettingsScreen(_context, trackersModule)); _screensManager.Add(PassengerSettingsScreen.ScreenName, new PassengerSettingsScreen(_context, passengerModule)); _screensManager.Add(SnugSettingsScreen.ScreenName, new SnugSettingsScreen(_context, snugModule)); _screensManager.Add(HideGeometrySettingsScreen.ScreenName, new HideGeometrySettingsScreen(_context, hideGeometryModule)); _screensManager.Add(OffsetCameraSettingsScreen.ScreenName, new OffsetCameraSettingsScreen(_context, offsetCameraModule)); _screensManager.Add(WorldScaleSettingsScreen.ScreenName, new WorldScaleSettingsScreen(_context, worldScaleModule)); _screensManager.Add(EyeTargetSettingsScreen.ScreenName, new EyeTargetSettingsScreen(_context, eyeTargetModule)); _screensManager.Add(AutomationSettingsScreen.ScreenName, new AutomationSettingsScreen(_context, automationModule)); _screensManager.Add(WizardScreen.ScreenName, new WizardScreen(_context, wizardModule)); _screensManager.Add(ImportExportScreen.ScreenName, new ImportExportScreen(_context, this, worldScaleModule, snugModule)); _screensManager.Add(UtilitiesScreen.ScreenName, new UtilitiesScreen(_context)); activeJSON.setCallbackFunction = val => { if (val) { _context.Initialize(); foreach (var module in _modules.GetComponents <IEmbodyModule>()) { if (module.alwaysEnabled) { continue; } if (!module.selectedJSON.val) { module.enabledJSON.val = false; continue; } if (module.BeforeEnable()) { module.enabledJSON.val = true; } } } else { automationModule.Reset(); foreach (var module in _modules.GetComponents <IEmbodyModule>().Reverse()) { if (module.alwaysEnabled) { continue; } module.enabledJSON.val = false; } } }; RegisterBool(activeJSON); var activeToggle = CreateToggle(activeJSON, false); activeToggle.label = "Active"; activeToggle.backgroundColor = Color.cyan; activeToggle.labelText.fontStyle = FontStyle.Bold; var popup = CreateScrollablePopup(_screensManager.screensJSON); popup.popupPanelHeight = 700f; popup.AddNav(this); SuperController.singleton.StartCoroutine(DeferredInit()); } catch (Exception) { enabledJSON.val = false; if (_modules != null) { Destroy(_modules); } throw; } }
public RecordPlayerHeightStep(EmbodyContext context) : base(context) { _playerMeasurements = new PlayerMeasurements(context); }
public AskSnugStep(EmbodyContext context, List <IWizardStep> steps) : base(context) { _steps = steps; }
public ResetPoseStep(EmbodyContext context) : base(context) { }
public DiagnosticsScreen(EmbodyContext context, IDiagnosticsModule diagnostics) : base(context) { _diagnostics = diagnostics; }