Exemple #1
0
        protected override void PopulatePresetObjectForSaving(PresetScriptableObject preset)
        {
            DynamicForcePanelPresetScriptableObject dynamicForcePanelPreset = preset as DynamicForcePanelPresetScriptableObject;

            dynamicForcePanelPreset.thumbSelected        = thumbToggle.isOn;
            dynamicForcePanelPreset.indexFingerSelected  = indexFingerToggle.isOn;
            dynamicForcePanelPreset.middleFingerSelected = middleFingerToggle.isOn;
            dynamicForcePanelPreset.ringFingerSelected   = ringFingerToggle.isOn;
            dynamicForcePanelPreset.pinkyFingerSelected  = pinkyFingerToggle.isOn;

            dynamicForcePanelPreset.targetForcePercentage = (int)targetForceSlider.value;

            dynamicForcePanelPreset.staticPhaseDuration     = float.Parse(staticPhaseDurationInputField.text);
            dynamicForcePanelPreset.increasingPhaseDuration = float.Parse(increasingPhaseDurationInputField.text);
            dynamicForcePanelPreset.plateauPhaseDuration    = float.Parse(plateauPhaseDurationInputField.text);
            dynamicForcePanelPreset.decreasingPhaseDuration = float.Parse(decreasingPhaseDurationInputField.text);
            dynamicForcePanelPreset.staticEndPhaseDuration  = float.Parse(staticEndPhaseDurationInputField.text);
        }
Exemple #2
0
        protected override void LoadPreset(PresetScriptableObject preset)
        {
            DynamicForcePanelPresetScriptableObject dynamicForcePanelPreset = preset as DynamicForcePanelPresetScriptableObject;

            thumbToggle.isOn        = dynamicForcePanelPreset.thumbSelected;
            indexFingerToggle.isOn  = dynamicForcePanelPreset.indexFingerSelected;
            middleFingerToggle.isOn = dynamicForcePanelPreset.middleFingerSelected;
            ringFingerToggle.isOn   = dynamicForcePanelPreset.ringFingerSelected;
            pinkyFingerToggle.isOn  = dynamicForcePanelPreset.pinkyFingerSelected;

            targetForceSlider.value = dynamicForcePanelPreset.targetForcePercentage;

            staticPhaseDurationInputField.text     = dynamicForcePanelPreset.staticPhaseDuration.ToString();
            increasingPhaseDurationInputField.text = dynamicForcePanelPreset.increasingPhaseDuration.ToString();
            plateauPhaseDurationInputField.text    = dynamicForcePanelPreset.plateauPhaseDuration.ToString();
            decreasingPhaseDurationInputField.text = dynamicForcePanelPreset.decreasingPhaseDuration.ToString();
            staticEndPhaseDurationInputField.text  = dynamicForcePanelPreset.staticEndPhaseDuration.ToString();
        }