Skip to content

Commit

Permalink
[1.1.1] Fixed the animation of closing settings (#4)
Browse files Browse the repository at this point in the history
* Fix issues with settings animation
* Fix package name in README
  • Loading branch information
Carapacik authored Apr 19, 2022
1 parent e2270bb commit 8cc6a13
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Assets/Scenes/Lvl1.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,14 @@ PrefabInstance:
propertyPath: m_Name
value: Victory
objectReference: {fileID: 0}
- target: {fileID: 3338031591941854971, guid: 27c2bd5700f576947927f549ebca5377, type: 3}
propertyPath: needToHide.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3338031591941854971, guid: 27c2bd5700f576947927f549ebca5377, type: 3}
propertyPath: needToHide.Array.data[0]
value:
objectReference: {fileID: 1733671630}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 27c2bd5700f576947927f549ebca5377, type: 3}
--- !u!1001 &6941278968805991357
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scenes/Lvl9.unity
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,14 @@ PrefabInstance:
propertyPath: m_Name
value: Victory
objectReference: {fileID: 0}
- target: {fileID: 3338031591941854971, guid: 27c2bd5700f576947927f549ebca5377, type: 3}
propertyPath: needToHide.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3338031591941854971, guid: 27c2bd5700f576947927f549ebca5377, type: 3}
propertyPath: needToHide.Array.data[0]
value:
objectReference: {fileID: 984897188}
- target: {fileID: 3338031593245846864, guid: 27c2bd5700f576947927f549ebca5377, type: 3}
propertyPath: m_AnchorMax.x
value: 1
Expand Down
7 changes: 7 additions & 0 deletions Assets/Scripts/SettingsAnimationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class SettingsAnimationsController : MonoBehaviour
{
[SerializeField] private GameObject settingsBox;
[SerializeField] private GameObject shadowBackground;
private bool _animationProgress;
private GameObject[] _belts;

private void Start()
Expand All @@ -15,18 +16,23 @@ private void Start()

public void OpenSettings()
{
if (_animationProgress) return;
_animationProgress = true;
shadowBackground.transform.GetComponent<Image>().DOFade(0.5f, 1);
settingsBox.transform.DOLocalMoveY(760, 0);
ObjectExtension.GetSavedObjects()[0].transform.GetComponent<AudioSource>().DOPitch(0.8f, 1);
settingsBox.transform.DOLocalMoveY(520, 1)
.OnComplete(() =>
{
foreach (var belt in _belts) belt.gameObject.GetComponent<SwapBeltz>().enabled = false;
_animationProgress = false;
});
}

public void CloseSettings()
{
if (_animationProgress) return;
_animationProgress = true;
shadowBackground.transform.GetComponent<Image>().DOFade(0, 1);
settingsBox.transform.DOLocalMoveY(520, 0);
ObjectExtension.GetSavedObjects()[0].transform.GetComponent<AudioSource>().DOPitch(1, 1);
Expand All @@ -36,6 +42,7 @@ public void CloseSettings()
foreach (var belt in _belts) belt.gameObject.GetComponent<SwapBeltz>().enabled = true;
shadowBackground.SetActive(false);
gameObject.SetActive(false);
_animationProgress = false;
});
}
}
2 changes: 2 additions & 0 deletions Assets/Scripts/VictoryAnimationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
public class VictoryAnimationsController : MonoBehaviour
{
[SerializeField] private GameObject victoryBox;
[SerializeField] private GameObject[] needToHide;

private void Start()
{
PlayVictorySound();
gameObject.transform.GetComponent<Image>().DOFade(0.6f, 2).OnComplete(() =>
{
foreach (var item in needToHide) item.SetActive(false);
victoryBox.SetActive(true);
victoryBox.transform.DOScale(1, 1);
});
Expand Down
6 changes: 3 additions & 3 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.1.0
bundleVersion: 1.1.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand All @@ -160,8 +160,8 @@ PlayerSettings:
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 1
AndroidBundleVersionCode: 5
AndroidMinSdkVersion: 24
AndroidBundleVersionCode: 7
AndroidMinSdkVersion: 23
AndroidTargetSdkVersion: 32
AndroidPreferredInstallLocation: 1
aotOptions:
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/RiderScriptEditorPersistedState.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ MonoBehaviour:
m_Script: {fileID: 0}
m_Name:
m_EditorClassIdentifier: Unity.Rider.Editor:Packages.Rider.Editor:RiderScriptEditorPersistedState
lastWriteTicks: -8585513947799261155
lastWriteTicks: -8585512297529382775
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Beltz

<a href='https://play.google.com/store/apps/details?id=com.Carapacik.Beltz'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height='100px'/></a>
<a href='https://play.google.com/store/apps/details?id=com.carapacik.beltz'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height='90px'/></a>

### Hyper-casual 2d puzzle game
The game is a system of *shafts* and *belts*. It is necessary to make sure that the belts are in the correct position, so that the shafts begin to spin.
Expand Down

0 comments on commit 8cc6a13

Please sign in to comment.