Skip to content

Commit

Permalink
Last level
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillemsc committed Mar 30, 2022
1 parent 1e7281a commit 57ea46b
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 20 deletions.
209 changes: 201 additions & 8 deletions Assets/Fueler/Prefabs/Ui/AllLevelsCompletedUi.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ RectTransform:
- {fileID: 4031750767657062060}
- {fileID: 4338980141944065396}
- {fileID: 2250819402465119660}
- {fileID: 6262719619442353762}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -539,6 +540,138 @@ MonoBehaviour:
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &3734873281558071854
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6262719619442353762}
- component: {fileID: 1189186543659414104}
m_Layer: 5
m_Name: Audio
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6262719619442353762
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3734873281558071854}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3413596312755163515}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!82 &1189186543659414104
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3734873281558071854}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 7372341130414966504, guid: 1933319f4459b674cad9eee6ffc942f1, type: 2}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &4760283934779131046
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -10834,6 +10967,8 @@ MonoBehaviour:
- id: 15
- id: 16
- id: 17
- id: 18
- id: 19
bindingEnabled: 0
bindableDataUid:
references:
Expand Down Expand Up @@ -11290,6 +11425,35 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
0000000A:
type: {class: AudioSourcePlayOneShotComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
enabled: 1
target:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: {fileID: 1189186543659414104}
value:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: {fileID: 8300000, guid: eca68b0668216904ca75389cdf140ced, type: 3}
volumeScale:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: 0.5
delay:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: 0.2
0000000B:
type: {class: ParticleSystemPlayComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand All @@ -11312,7 +11476,7 @@ MonoBehaviour:
binded: 0
bindedVariableName:
FallbackValue: 0.2
0000000B:
0000000C:
type: {class: TransformLocalScaleComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand Down Expand Up @@ -11370,7 +11534,36 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
0000000C:
0000000D:
type: {class: AudioSourcePlayOneShotComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
enabled: 1
target:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: {fileID: 1189186543659414104}
value:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: {fileID: 8300000, guid: eca68b0668216904ca75389cdf140ced, type: 3}
volumeScale:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: 0.5
delay:
bindingEnabled: 0
wantsToBeBinded: 0
binded: 0
bindedVariableName:
FallbackValue: 1.2
0000000E:
type: {class: ParticleSystemPlayComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand All @@ -11393,7 +11586,7 @@ MonoBehaviour:
binded: 0
bindedVariableName:
FallbackValue: 1.2
0000000D:
0000000F:
type: {class: UIAlphaComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand Down Expand Up @@ -11451,7 +11644,7 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
0000000E:
00000010:
type: {class: WaitAllAboveComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand All @@ -11462,7 +11655,7 @@ MonoBehaviour:
binded: 0
bindedVariableName:
FallbackValue: 0
0000000F:
00000011:
type: {class: UIInteractableComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand Down Expand Up @@ -11491,7 +11684,7 @@ MonoBehaviour:
binded: 0
bindedVariableName:
FallbackValue: 0
00000010:
00000012:
type: {class: UIAlphaComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 1
Expand Down Expand Up @@ -11549,10 +11742,10 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
00000011:
00000013:
type: {class: UIAlphaComponent, ns: Juce.TweenComponent.Components, asm: Juce.TweenComponent.Runtime}
data:
folded: 0
folded: 1
enabled: 1
target:
bindingEnabled: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ SerializableData<LevelsPersistence> levelsSerializable

public void Execute(ILevelConfiguration levelConfiguration, bool serialize)
{
bool alreadyAdded = levelsSerializable.Data.CompletedLevels.Contains(levelConfiguration.Id);
bool isLastPlayedLevel = levelsSerializable.Data.LastPlayedLevel == levelConfiguration.Id;

if(alreadyAdded)
if (isLastPlayedLevel)
{
return;
levelsSerializable.Data.LastPlayedLevelCompleted = true;
}

levelsSerializable.Data.CompletedLevels.Add(levelConfiguration.Id);

bool isLastPlayedLevel = levelsSerializable.Data.LastPlayedLevel == levelConfiguration.Id;
bool alreadyAdded = levelsSerializable.Data.CompletedLevels.Contains(levelConfiguration.Id);

if (isLastPlayedLevel)
if (!alreadyAdded)
{
levelsSerializable.Data.LastPlayedLevelCompleted = true;
levelsSerializable.Data.CompletedLevels.Add(levelConfiguration.Id);
}

if (serialize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ private void UpdateAutobreak()
autobreakNormalizedTime = (float)autobreakTimer.Time.TotalSeconds / autobreakTime;
}

UnityEngine.Debug.Log(autobreakNormalizedTime);

Vector2 newCurrentSpeed = Vector2.Lerp(startingAutobreakSpeed, Vector2.zero, autobreakNormalizedTime);

currentSpeed = newCurrentSpeed;
Expand Down
4 changes: 2 additions & 2 deletions UserSettings/EditorUserSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ EditorUserSettings:
value: 224247031146467d180b0027026c6c1313191d39630a293f393a0921e3f02777cfe63fe7c53530282a16fd3d14701431fb1e10
flags: 0
RecentlyUsedScenePath-8:
value: 224247031146467d180b0027026c6c1313191d39630b293e392c0527f1af072ce3e033cae8342b392116a1290a371526
value: 224247031146467d180b0027026c6c1313191d39630a293f393a0921e3f02777c3f222e6eb353e381507f939081c0e30e6191d19f71b441e1f07e917
flags: 0
RecentlyUsedScenePath-9:
value: 224247031146467d180b0027026c6c1313191d39630a293f393a0921e3f02777c3f222e6eb353e381507f939081c0e30e6191d19f71b441e1f07e917
value: 224247031146467d180b0027026c6c1313191d39630b293e392c0527f1af072ce3e033cae8342b392116a1290a371526
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
Expand Down

0 comments on commit 57ea46b

Please sign in to comment.