/// <summary> /// On Play we trigger the desired wiggles /// </summary> /// <param name="position"></param> /// <param name="attenuation"></param> protected override void CustomPlayFeedback(Vector3 position, float attenuation = 1.0f) { if (Active && (TargetWiggle != null)) { if (WigglePosition) { TargetWiggle.WigglePosition(WigglePositionDuration); } else { TargetWiggle.StopWigglePosition(); } if (WiggleRotation) { TargetWiggle.WiggleRotation(WiggleRotationDuration); } else { TargetWiggle.StopWiggleRotation(); } if (WiggleScale) { TargetWiggle.WiggleScale(WiggleScaleDuration); } else { TargetWiggle.StopWiggleScale(); } } }
/// <summary> /// On Play we trigger the desired wiggles /// </summary> /// <param name="position"></param> /// <param name="feedbacksIntensity"></param> protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f) { if (Active && (TargetWiggle != null)) { if (WigglePosition) { TargetWiggle.WigglePosition(ApplyTimeMultiplier(WigglePositionDuration)); } if (WiggleRotation) { TargetWiggle.WiggleRotation(ApplyTimeMultiplier(WiggleRotationDuration)); } if (WiggleScale) { TargetWiggle.WiggleScale(ApplyTimeMultiplier(WiggleScaleDuration)); } } }
/// <summary> /// On Play we trigger the desired wiggles /// </summary> /// <param name="position"></param> /// <param name="feedbacksIntensity"></param> protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f) { if (Active && (TargetWiggle != null)) { if (WigglePosition) { TargetWiggle.PositionWiggleProperties.UseUnscaledTime = Timing.TimescaleMode == TimescaleModes.Unscaled; TargetWiggle.WigglePosition(ApplyTimeMultiplier(WigglePositionDuration)); } if (WiggleRotation) { TargetWiggle.RotationWiggleProperties.UseUnscaledTime = Timing.TimescaleMode == TimescaleModes.Unscaled; TargetWiggle.WiggleRotation(ApplyTimeMultiplier(WiggleRotationDuration)); } if (WiggleScale) { TargetWiggle.ScaleWiggleProperties.UseUnscaledTime = Timing.TimescaleMode == TimescaleModes.Unscaled; TargetWiggle.WiggleScale(ApplyTimeMultiplier(WiggleScaleDuration)); } } }
public override void OnInspectorGUI() { serializedObject.Update(); Undo.RecordObject(target, "Modified MMWiggle"); EditorGUILayout.Space(); EditorGUILayout.PropertyField(_updateMode); EditorGUILayout.Space(); MMFeedbackStyling.DrawSplitter(); DrawValueEditor("Position", _positionActive, _positionEditorProperties, _mmWiggle.PositionWiggleProperties.WiggleType); DrawValueEditor("Rotation", _rotationActive, _rotationEditorProperties, _mmWiggle.RotationWiggleProperties.WiggleType); DrawValueEditor("Scale", _scaleActive, _scaleEditorProperties, _mmWiggle.ScaleWiggleProperties.WiggleType); EditorGUILayout.Space(); EditorGUILayout.LabelField("Debug", EditorStyles.boldLabel); EditorGUILayout.PropertyField(_debugWiggleDuration); EditorGUILayout.BeginHorizontal(); { if (GUILayout.Button("Wiggle Position", EditorStyles.miniButtonLeft)) { _mmWiggle.WigglePosition(_debugWiggleDuration.floatValue); } if (GUILayout.Button("Wiggle Rotation", EditorStyles.miniButtonMid)) { _mmWiggle.WiggleRotation(_debugWiggleDuration.floatValue); } if (GUILayout.Button("Wiggle Scale", EditorStyles.miniButtonRight)) { _mmWiggle.WiggleScale(_debugWiggleDuration.floatValue); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); serializedObject.ApplyModifiedProperties(); }
/// <summary> /// On Play we trigger the desired wiggles /// </summary> /// <param name="position"></param> /// <param name="feedbacksIntensity"></param> protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f) { if (!Active || !FeedbackTypeAuthorized || (TargetWiggle == null)) { return; } TargetWiggle.enabled = true; if (WigglePosition) { TargetWiggle.PositionWiggleProperties.UseUnscaledTime = Timing.TimescaleMode == TimescaleModes.Unscaled; TargetWiggle.WigglePosition(ApplyTimeMultiplier(WigglePositionDuration)); } if (WiggleRotation) { TargetWiggle.RotationWiggleProperties.UseUnscaledTime = Timing.TimescaleMode == TimescaleModes.Unscaled; TargetWiggle.WiggleRotation(ApplyTimeMultiplier(WiggleRotationDuration)); } if (WiggleScale) { TargetWiggle.ScaleWiggleProperties.UseUnscaledTime = Timing.TimescaleMode == TimescaleModes.Unscaled; TargetWiggle.WiggleScale(ApplyTimeMultiplier(WiggleScaleDuration)); } }