Skip to content

Commit

Permalink
pause button + responsive ui
Browse files Browse the repository at this point in the history
  • Loading branch information
kareemalkoul committed Jun 12, 2022
1 parent 6d7c1b2 commit 582e63f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Assets/Scenes/sph-kareem.unity
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 445, y: -189.5}
m_AnchoredPosition: {x: 452, y: -263}
m_SizeDelta: {x: 277.90002, y: 380.2}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &31206669
Expand Down Expand Up @@ -512,7 +512,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 72064454}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1608701061}
Expand All @@ -529,7 +529,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 138.77008, y: -190}
m_AnchoredPosition: {x: 150, y: -203}
m_SizeDelta: {x: 277.53802, y: 380}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &72064456
Expand Down Expand Up @@ -3241,7 +3241,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 451411934}
m_LocalRotation: {x: -0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 1.018734, y: 40.746994, z: -57.353745}
m_LocalPosition: {x: 1.018734, y: 40.67, z: -57.353745}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 753339211}
Expand Down Expand Up @@ -8221,12 +8221,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 891.6, y: 380.4}
m_ReferenceResolution: {x: 900, y: 493.6}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 1
m_MatchWidthOrHeight: 0.5
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
Expand Down Expand Up @@ -8279,7 +8279,7 @@ RectTransform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1115475681}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalPosition: {x: 0, y: 0, z: -0.4}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 31206668}
Expand All @@ -8290,8 +8290,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 445, y: -190}
m_SizeDelta: {x: 889.99994, y: 380.00003}
m_AnchoredPosition: {x: 444, y: -249.8}
m_SizeDelta: {x: 890, y: 499.6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1115475683
MonoBehaviour:
Expand Down Expand Up @@ -11271,7 +11271,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 755.37, y: -189.8}
m_AnchoredPosition: {x: 748, y: -303}
m_SizeDelta: {x: 269.27, y: 379.6}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1664645798
Expand Down
10 changes: 10 additions & 0 deletions Assets/Scripts/utils/PauseMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ void Update()
{
ChangeGameState();
}

Stop();
}

public void DropDwonWithParticlesEnum(Dropdown dropdown, Enum targetEnum) //You can populate any dropdown with any enum with this method
Expand Down Expand Up @@ -189,6 +191,14 @@ public void Restart()
{
Application.LoadLevel(Application.loadedLevel);
}

public void Stop()
{
if (Input.GetKeyDown(KeyCode.Space))
{
fluid.simulate = !fluid.simulate;
}
}
//Ouput the new value of the Dropdown into Text
#endregion

Expand Down

0 comments on commit 582e63f

Please sign in to comment.