Skip to content

Commit

Permalink
v_1.7
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
joellui committed Jul 8, 2021
1 parent e5ff3d3 commit f965376
Show file tree
Hide file tree
Showing 10 changed files with 617 additions and 144 deletions.
120 changes: 119 additions & 1 deletion Assets/Scenes/GameScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -5226,6 +5226,85 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &563416887
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 563416888}
- component: {fileID: 563416890}
- component: {fileID: 563416889}
m_Layer: 5
m_Name: Seconds screen
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &563416888
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 563416887}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.74074084, y: 0.74074084, z: 0.74074084}
m_Children: []
m_Father: {fileID: 1313534858}
m_RootOrder: 0
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: 282, y: 619}
m_SizeDelta: {x: 319.6289, y: 249.1919}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &563416889
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 563416887}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.8000001, g: 0.2392157, b: 0.2392157, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 458b1b0ef46999440b73c69a6a8f1edd, type: 3}
m_FontSize: 300
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 9
m_MaxSize: 300
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 0
--- !u!222 &563416890
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 563416887}
m_CullTransparentMesh: 1
--- !u!1 &659110430
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6072,6 +6151,42 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1091626614}
m_CullTransparentMesh: 1
--- !u!1 &1313534857
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1313534858}
m_Layer: 5
m_Name: secondsBoard
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1313534858
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313534857}
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:
- {fileID: 563416888}
m_Father: {fileID: 1688433348}
m_RootOrder: 0
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: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1338811275
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6189,7 +6304,7 @@ Transform:
- {fileID: 757477823}
- {fileID: 2074272068}
m_Father: {fileID: 1688433348}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1553914659
GameObject:
Expand Down Expand Up @@ -6408,6 +6523,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1313534858}
- {fileID: 1426946431}
m_Father: {fileID: 0}
m_RootOrder: 3
Expand Down Expand Up @@ -6506,6 +6622,8 @@ MonoBehaviour:
gameOverScreen: {fileID: 1426946430}
secondsServivedUI: {fileID: 1553914661}
highScoreSecondServivedUI: {fileID: 1091626616}
seconds: {fileID: 563416889}
secondsBoard: {fileID: 1313534857}
--- !u!4 &1958086437
Transform:
m_ObjectHideFlags: 0
Expand Down
139 changes: 137 additions & 2 deletions Assets/Scenes/Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ RectTransform:
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.0035434, y: 174}
m_AnchoredPosition: {x: 0.0035434, y: 99}
m_SizeDelta: {x: 798.73, y: 228.4763}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &209128087
Expand Down Expand Up @@ -914,6 +914,140 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &703008981
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 703008982}
- component: {fileID: 703008984}
- component: {fileID: 703008983}
m_Layer: 5
m_Name: Instructions
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &703008982
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 703008981}
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: 1496435887}
m_RootOrder: 10
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.0035265, y: 205.82}
m_SizeDelta: {x: 798.73, y: 164.842}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &703008983
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 703008981}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Tap and hold to dodge the asteroid
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 51198bbdd3f4b7344b272e83f21115e6, type: 2}
m_sharedMaterial: {fileID: 8913251195584052683, guid: 51198bbdd3f4b7344b272e83f21115e6, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 2986344447
m_fontColor: {r: 1, g: 1, b: 1, a: 0.69411767}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 106.08
m_fontSizeBase: 106.08
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &703008984
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 703008981}
m_CullTransparentMesh: 1
--- !u!1 &945160578
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1603,6 +1737,7 @@ RectTransform:
- {fileID: 209128086}
- {fileID: 1715930982}
- {fileID: 140042420}
- {fileID: 703008982}
m_Father: {fileID: 1389329793}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -1623,7 +1758,7 @@ GameObject:
- component: {fileID: 1530056622}
- component: {fileID: 1530056621}
m_Layer: 5
m_Name: Text
m_Name: Score
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down
1 change: 1 addition & 0 deletions Assets/Script/GPSAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void Initialize()

void signinwithplaygames()
{

PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptOnce, (success) =>
{
switch (success)
Expand Down
16 changes: 11 additions & 5 deletions Assets/Script/GameOver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public class GameOver : MonoBehaviour
public Text secondsServivedUI;
public Text highScoreSecondServivedUI;
private bool gameOver;
public Text seconds;
public GameObject secondsBoard;


// Start is called before the first frame update
Expand All @@ -18,11 +20,7 @@ void Start()
FindObjectOfType<PlayerController>().OnPlayerDeath += onGameOver;
}

// Update is called once per frame
void Update()
{

}


public void restart()
{
Expand Down Expand Up @@ -50,12 +48,20 @@ public void postscoretoleaderboard()
});
}

private void Update()
{
seconds.text = Mathf.RoundToInt(Time.timeSinceLevelLoad).ToString();
}

void onGameOver()
{
gameOverScreen.SetActive(true);
secondsBoard.SetActive(false);

int secondsSurvived = Mathf.RoundToInt(Time.timeSinceLevelLoad);



if (secondsSurvived > PlayerPrefs.GetFloat("highScore",0))
{
PlayerPrefs.SetFloat("highScore",secondsSurvived);
Expand Down
Loading

0 comments on commit f965376

Please sign in to comment.