Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions UnityPomodoro/Assets/AdrianMiasik/Animations/DigitPulseWobble.anim
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DigitPulseWobble
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions UnityPomodoro/Assets/AdrianMiasik/Prefabs/Double Digit.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ GameObject:
- component: {fileID: 9103386490340751771}
- component: {fileID: 6390431754232334622}
- component: {fileID: 2012381756492514942}
- component: {fileID: 4632816809682780623}
m_Layer: 5
m_Name: Double Digit
m_TagString: Untagged
Expand Down Expand Up @@ -313,6 +314,7 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
pulseWobble: {fileID: 4632816809682780623}
color: {r: 1, g: 1, b: 1, a: 1}
selectionColor: {r: 0.90588236, g: 0.90588236, b: 0.90588236, a: 1}
OnSelection:
Expand Down Expand Up @@ -487,6 +489,22 @@ AudioSource:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!111 &4632816809682780623
Animation:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2939933545387467009}
m_Enabled: 1
serializedVersion: 3
m_Animation: {fileID: 7400000, guid: 127bfb933f40d644481b0db606e562f3, type: 2}
m_Animations:
- {fileID: 7400000, guid: 127bfb933f40d644481b0db606e562f3, type: 2}
m_WrapMode: 0
m_PlayAutomatically: 0
m_AnimatePhysics: 0
m_CullingType: 0
--- !u!1 &2939933545557774692
GameObject:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class DoubleDigit : MonoBehaviour, ISelectHandler, IPointerClickHandler,
[SerializeField] private float animationDuration = 0.25f;
[SerializeField] private AnimationCurve animationRamp = AnimationCurve.EaseInOut(0, 0, 1, 1);

[Header("Wobble")]
[SerializeField] private Animation pulseWobble;

private PomodoroTimer.Digits digit;
private PomodoroTimer timer;
private bool isInteractable;
Expand Down Expand Up @@ -66,6 +69,7 @@ public void Initialize(PomodoroTimer.Digits digit, PomodoroTimer timer, int digi
SetSquircleColor(color);
SetDigitsLabel(digits);
HideArrows();
pulseWobble.Stop();
}

private void Update()
Expand Down Expand Up @@ -235,6 +239,8 @@ public void IncrementOne()
{
timer.IncrementOne(digit);
SetDigitsLabel(timer.GetDigitValue(digit));
pulseWobble.Stop();
pulseWobble.Play();
UpdateArrows();
accumulatedSelectionTime = 0;
}
Expand All @@ -246,6 +252,8 @@ public void DecrementOne()
{
timer.DecrementOne(digit);
SetDigitsLabel(timer.GetDigitValue(digit));
pulseWobble.Stop();
pulseWobble.Play();
UpdateArrows();
accumulatedSelectionTime = 0;
}
Expand Down