Mise en place écran de sauvegarde d'un records + modifs mineures
This commit is contained in:
parent
fc2986fed1
commit
e6bdb274f0
@ -9,52 +9,18 @@ Prefab:
|
||||
m_Modifications: []
|
||||
m_RemovedComponents: []
|
||||
m_ParentPrefab: {fileID: 0}
|
||||
m_RootGameObject: {fileID: 1382578555604178}
|
||||
m_RootGameObject: {fileID: 1051963178499332}
|
||||
m_IsPrefabParent: 1
|
||||
--- !u!1 &1041592609683764
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224115740704882178}
|
||||
- component: {fileID: 222435295466825602}
|
||||
- component: {fileID: 114172407958408760}
|
||||
m_Layer: 5
|
||||
m_Name: Selection
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1089116114540858
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224681986931529282}
|
||||
- component: {fileID: 222452745096560084}
|
||||
- component: {fileID: 114065969564807698}
|
||||
m_Layer: 5
|
||||
m_Name: UpButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1356742268285932
|
||||
--- !u!1 &1014249960838278
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224956512153907960}
|
||||
- component: {fileID: 222757616980664170}
|
||||
- component: {fileID: 114661186600044386}
|
||||
- component: {fileID: 224684712656177848}
|
||||
- component: {fileID: 222456798772706968}
|
||||
- component: {fileID: 114679866794346290}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
@ -62,18 +28,18 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1382578555604178
|
||||
--- !u!1 &1051963178499332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224969415226408660}
|
||||
- component: {fileID: 222077191492961472}
|
||||
- component: {fileID: 114251579888339578}
|
||||
- component: {fileID: 114706256909783090}
|
||||
- component: {fileID: 114828288612452432}
|
||||
- component: {fileID: 224998143105840122}
|
||||
- component: {fileID: 222838574225832660}
|
||||
- component: {fileID: 114176501444933120}
|
||||
- component: {fileID: 114280854080925822}
|
||||
- component: {fileID: 114387664711548092}
|
||||
m_Layer: 5
|
||||
m_Name: LetterPanel
|
||||
m_TagString: Untagged
|
||||
@ -81,16 +47,33 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1645711040096332
|
||||
--- !u!1 &1493435800239748
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224466170424052486}
|
||||
- component: {fileID: 222298539005622540}
|
||||
- component: {fileID: 114563672861759042}
|
||||
- component: {fileID: 224955305068670170}
|
||||
- component: {fileID: 222126966544715454}
|
||||
- component: {fileID: 114000071387496732}
|
||||
m_Layer: 5
|
||||
m_Name: UpButton
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1559861796336344
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224092313304127712}
|
||||
- component: {fileID: 222560502579918012}
|
||||
- component: {fileID: 114663662027557110}
|
||||
m_Layer: 5
|
||||
m_Name: LetterText
|
||||
m_TagString: Untagged
|
||||
@ -98,16 +81,16 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1884956468928564
|
||||
--- !u!1 &1598755808763062
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224608004733392416}
|
||||
- component: {fileID: 222690400729717274}
|
||||
- component: {fileID: 114700085448092974}
|
||||
- component: {fileID: 224952752019128638}
|
||||
- component: {fileID: 222291691562608014}
|
||||
- component: {fileID: 114977499046591402}
|
||||
m_Layer: 5
|
||||
m_Name: DownButton
|
||||
m_TagString: Untagged
|
||||
@ -115,16 +98,16 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!1 &1972475328904656
|
||||
--- !u!1 &1610094281911818
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224668835183798818}
|
||||
- component: {fileID: 222494436874561192}
|
||||
- component: {fileID: 114070606239393484}
|
||||
- component: {fileID: 224210668207720556}
|
||||
- component: {fileID: 222453674594861944}
|
||||
- component: {fileID: 114942577032066196}
|
||||
m_Layer: 5
|
||||
m_Name: TestImage
|
||||
m_TagString: Untagged
|
||||
@ -132,12 +115,29 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &114065969564807698
|
||||
--- !u!1 &1678894884701406
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
serializedVersion: 5
|
||||
m_Component:
|
||||
- component: {fileID: 224880313257080756}
|
||||
- component: {fileID: 222845326873806298}
|
||||
- component: {fileID: 114123306587963296}
|
||||
m_Layer: 5
|
||||
m_Name: Selection
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!114 &114000071387496732
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1089116114540858}
|
||||
m_GameObject: {fileID: 1493435800239748}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
@ -171,7 +171,7 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 114828288612452432}
|
||||
- m_Target: {fileID: 114387664711548092}
|
||||
m_MethodName: ChangeLetter
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
@ -184,46 +184,19 @@ MonoBehaviour:
|
||||
m_CallState: 2
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!114 &114070606239393484
|
||||
--- !u!114 &114123306587963296
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1972475328904656}
|
||||
m_GameObject: {fileID: 1678894884701406}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: 462453b99013d444aab88fa32a3127c4, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!114 &114172407958408760
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1041592609683764}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.82745105, g: 0.8313726, b: 0.6313726, a: 1}
|
||||
m_Color: {r: 0.92156863, g: 0.91764706, b: 0.7019608, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
@ -238,12 +211,12 @@ MonoBehaviour:
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!114 &114251579888339578
|
||||
--- !u!114 &114176501444933120
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1382578555604178}
|
||||
m_GameObject: {fileID: 1051963178499332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
@ -265,19 +238,57 @@ MonoBehaviour:
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!114 &114563672861759042
|
||||
--- !u!114 &114280854080925822
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1645711040096332}
|
||||
m_GameObject: {fileID: 1051963178499332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
--- !u!114 &114387664711548092
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1051963178499332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 718cda631653149408754c139b62179e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
UpButton: {fileID: 114000071387496732}
|
||||
DownButton: {fileID: 114977499046591402}
|
||||
LetterText: {fileID: 114663662027557110}
|
||||
YAxis: VerticalP1
|
||||
InputDelay: 200
|
||||
--- !u!114 &114663662027557110
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1559861796336344}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.83137256, g: 0.8352941, b: 0.63529414, a: 1}
|
||||
m_Color: {r: 0.92156863, g: 0.91764706, b: 0.7019608, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
@ -285,8 +296,8 @@ MonoBehaviour:
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_FontData:
|
||||
m_Font: {fileID: 12800000, guid: 8716cefd1802c7046b79c87025899665, type: 3}
|
||||
m_FontSize: 50
|
||||
m_Font: {fileID: 12800000, guid: 0c90228a5041e3e46870c5be76316d08, type: 3}
|
||||
m_FontSize: 60
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 0
|
||||
@ -298,12 +309,12 @@ MonoBehaviour:
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: A
|
||||
--- !u!114 &114661186600044386
|
||||
--- !u!114 &114679866794346290
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1356742268285932}
|
||||
m_GameObject: {fileID: 1014249960838278}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
@ -317,7 +328,7 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: dddf2dff1f7470246866a32ca150dbd0, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 3565834229cb3ba42a5f571e4b96b090, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
@ -325,12 +336,39 @@ MonoBehaviour:
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!114 &114700085448092974
|
||||
--- !u!114 &114942577032066196
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1884956468928564}
|
||||
m_GameObject: {fileID: 1610094281911818}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
|
||||
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
|
||||
m_Sprite: {fileID: 21300000, guid: 6f995c6085568f84eaa0ee8753c3e210, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 1
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
--- !u!114 &114977499046591402
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1598755808763062}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
@ -364,7 +402,7 @@ MonoBehaviour:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 114828288612452432}
|
||||
- m_Target: {fileID: 114387664711548092}
|
||||
m_MethodName: ChangeLetter
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
@ -377,142 +415,132 @@ MonoBehaviour:
|
||||
m_CallState: 2
|
||||
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
--- !u!114 &114706256909783090
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1382578555604178}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1297475563, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 0
|
||||
m_Right: 0
|
||||
m_Top: 0
|
||||
m_Bottom: 0
|
||||
m_ChildAlignment: 4
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
--- !u!114 &114828288612452432
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1382578555604178}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 718cda631653149408754c139b62179e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
UpButton: {fileID: 114065969564807698}
|
||||
UpButtonSprite: {fileID: 21300000, guid: 462453b99013d444aab88fa32a3127c4, type: 3}
|
||||
PressedUpButtonSprite: {fileID: 21300000, guid: 6e81b656203ba064bb9c72a19f31000a,
|
||||
type: 3}
|
||||
DownButton: {fileID: 114700085448092974}
|
||||
DownButtonSprite: {fileID: 21300000, guid: dddf2dff1f7470246866a32ca150dbd0, type: 3}
|
||||
PressedDownButtonSprite: {fileID: 21300000, guid: b49cbdbc9e74b184685d92e9df680641,
|
||||
type: 3}
|
||||
LetterText: {fileID: 114563672861759042}
|
||||
Selector: {fileID: 1041592609683764}
|
||||
ColorSelection: {r: 0.69411767, g: 0.69803923, b: 0.5294118, a: 1}
|
||||
YAxis: VerticalP1
|
||||
InputDelay: 200
|
||||
--- !u!222 &222077191492961472
|
||||
--- !u!222 &222126966544715454
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1382578555604178}
|
||||
--- !u!222 &222298539005622540
|
||||
m_GameObject: {fileID: 1493435800239748}
|
||||
--- !u!222 &222291691562608014
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1645711040096332}
|
||||
--- !u!222 &222435295466825602
|
||||
m_GameObject: {fileID: 1598755808763062}
|
||||
--- !u!222 &222453674594861944
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1041592609683764}
|
||||
--- !u!222 &222452745096560084
|
||||
m_GameObject: {fileID: 1610094281911818}
|
||||
--- !u!222 &222456798772706968
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1089116114540858}
|
||||
--- !u!222 &222494436874561192
|
||||
m_GameObject: {fileID: 1014249960838278}
|
||||
--- !u!222 &222560502579918012
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1972475328904656}
|
||||
--- !u!222 &222690400729717274
|
||||
m_GameObject: {fileID: 1559861796336344}
|
||||
--- !u!222 &222838574225832660
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1884956468928564}
|
||||
--- !u!222 &222757616980664170
|
||||
m_GameObject: {fileID: 1051963178499332}
|
||||
--- !u!222 &222845326873806298
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1356742268285932}
|
||||
--- !u!224 &224115740704882178
|
||||
m_GameObject: {fileID: 1678894884701406}
|
||||
--- !u!224 &224092313304127712
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1041592609683764}
|
||||
m_GameObject: {fileID: 1559861796336344}
|
||||
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: 224969415226408660}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224466170424052486
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1645711040096332}
|
||||
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: 224969415226408660}
|
||||
m_Father: {fileID: 224998143105840122}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 160, y: 60.525}
|
||||
m_SizeDelta: {x: 70, y: 60.525}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224608004733392416
|
||||
--- !u!224 &224210668207720556
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1884956468928564}
|
||||
m_GameObject: {fileID: 1610094281911818}
|
||||
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: 224955305068670170}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224684712656177848
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1014249960838278}
|
||||
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: 224952752019128638}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224880313257080756
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1678894884701406}
|
||||
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: 224998143105840122}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 95.833336, y: -185.19688}
|
||||
m_SizeDelta: {x: 100, y: 10}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224952752019128638
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1598755808763062}
|
||||
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: 224956512153907960}
|
||||
m_Father: {fileID: 224969415226408660}
|
||||
- {fileID: 224684712656177848}
|
||||
m_Father: {fileID: 224998143105840122}
|
||||
m_RootOrder: 3
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@ -520,75 +548,39 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 20}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224668835183798818
|
||||
--- !u!224 &224955305068670170
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1972475328904656}
|
||||
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: 224681986931529282}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224681986931529282
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1089116114540858}
|
||||
m_GameObject: {fileID: 1493435800239748}
|
||||
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: 224668835183798818}
|
||||
m_Father: {fileID: 224969415226408660}
|
||||
- {fileID: 224210668207720556}
|
||||
m_Father: {fileID: 224998143105840122}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 20}
|
||||
m_SizeDelta: {x: 60, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224956512153907960
|
||||
--- !u!224 &224998143105840122
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1356742268285932}
|
||||
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: 224608004733392416}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!224 &224969415226408660
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 1
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 100100000}
|
||||
m_GameObject: {fileID: 1382578555604178}
|
||||
m_GameObject: {fileID: 1051963178499332}
|
||||
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: 224681986931529282}
|
||||
- {fileID: 224466170424052486}
|
||||
- {fileID: 224115740704882178}
|
||||
- {fileID: 224608004733392416}
|
||||
- {fileID: 224955305068670170}
|
||||
- {fileID: 224092313304127712}
|
||||
- {fileID: 224880313257080756}
|
||||
- {fileID: 224952752019128638}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
|
@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5a4f9907b182104dac5170e325fef73
|
||||
timeCreated: 1520950998
|
||||
guid: d5df03a0612222947a30c5be4549acdb
|
||||
timeCreated: 1521112694
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
|
@ -254,7 +254,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_Color: {r: 0.86764705, g: 0.34450695, b: 0.34450695, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
|
@ -221,6 +221,25 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 72b762e54d7534ee7b4f86534cf6d481, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Transports:
|
||||
- {fileID: 21300000, guid: 5e5aa15eeebbb9b4d91b51b1be4d1b9a, type: 3}
|
||||
- {fileID: 21300000, guid: 3f1c4bdd8395ac6429ff42fc32da9979, type: 3}
|
||||
- {fileID: 21300000, guid: 52f4e3480388c4d44a69d61037b9e748, type: 3}
|
||||
- {fileID: 21300000, guid: 7c46cf47738bd4942a6ecf581cad1b86, type: 3}
|
||||
- {fileID: 21300000, guid: c1892bf031c4dfe449720146bd70ceba, type: 3}
|
||||
- {fileID: 21300000, guid: 6a8f085d2aaf45944a3231f952e31ae9, type: 3}
|
||||
- {fileID: 21300000, guid: 52f4e3480388c4d44a69d61037b9e748, type: 3}
|
||||
- {fileID: 21300000, guid: 1e789aa866dfadd4ab1c6223848940b5, type: 3}
|
||||
GameSceneName: GameScene
|
||||
MenuSceneName: Menus
|
||||
EntryP1:
|
||||
pseudo:
|
||||
transport: 0
|
||||
timeStr: 0:40:20
|
||||
EntryP2:
|
||||
pseudo:
|
||||
transport: 0
|
||||
timeStr: 0:40:20
|
||||
--- !u!4 &587807404
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5759,7 +5759,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -235}
|
||||
m_AnchoredPosition: {x: 0, y: -255}
|
||||
m_SizeDelta: {x: 580, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1574281788
|
||||
@ -6235,7 +6235,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -105}
|
||||
m_SizeDelta: {x: 580, y: -430}
|
||||
m_SizeDelta: {x: 580, y: -390}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1766777651
|
||||
MonoBehaviour:
|
||||
|
18
Assets/Scripts/BaseInputBehavior.cs
Normal file
18
Assets/Scripts/BaseInputBehavior.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
public abstract class BaseInputBehavior : MonoBehaviour
|
||||
{
|
||||
protected DateTime lastInput;
|
||||
public int InputDelay = 100;
|
||||
|
||||
protected bool IsSpawned
|
||||
{
|
||||
get { return lastInput == null || (DateTime.Now - lastInput).Milliseconds < InputDelay; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
13
Assets/Scripts/BaseInputBehavior.cs.meta
Normal file
13
Assets/Scripts/BaseInputBehavior.cs.meta
Normal file
@ -0,0 +1,13 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a4fdcc117fa3c54cba3bfd30f90b484
|
||||
timeCreated: 1521125199
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,56 +1,98 @@
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public enum States {
|
||||
Menu = 0,
|
||||
LoadingScene = 5,
|
||||
LoadingVideo = 10,
|
||||
RaceSetup = 15,
|
||||
Race = 20
|
||||
public enum States
|
||||
{
|
||||
Menu = 0,
|
||||
LoadingScene = 5,
|
||||
LoadingVideo = 10,
|
||||
RaceSetup = 15,
|
||||
Race = 20
|
||||
}
|
||||
|
||||
public class GameManager : MonoBehaviour {
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
|
||||
private static GameManager _instance;
|
||||
public List<Sprite> Transports
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<Sprite> {
|
||||
Resources.Load<Sprite>("Images/metro_80x80"),
|
||||
Resources.Load<Sprite>("Images/bus_80x80"),
|
||||
Resources.Load<Sprite>("Images/deambulateur_80x80"),
|
||||
Resources.Load<Sprite>("Images/voiture_80x80"),
|
||||
Resources.Load<Sprite>("Images/lapetiterennes_80x80"),
|
||||
Resources.Load<Sprite>("Images/toutenvelo_80x80"),
|
||||
Resources.Load<Sprite>("Images/monocycle_80x80"),
|
||||
Resources.Load<Sprite>("Images/velopiste_80x80")
|
||||
};
|
||||
}
|
||||
}
|
||||
public string GameSceneName = "GameScene";
|
||||
public string MenuSceneName = "Menus";
|
||||
|
||||
public string XAxisP1 = "HorizontalP1";
|
||||
public string YAxisP1 = "VerticalP1";
|
||||
public string SubmitP1 = "SubmitP1";
|
||||
public string CancelP1 = "CancelP1";
|
||||
public string XAxisP2 = "HorizontalP2";
|
||||
public string YAxisP2 = "VerticalP2";
|
||||
public string SubmitP2 = "SubmitP2";
|
||||
public string CancelP2 = "CancelP2";
|
||||
|
||||
//public static GameManager Instance {get {return _instance; } }
|
||||
public static GameManager Instance {get {return _instance ?? (_instance =
|
||||
new GameObject("GameManager").AddComponent<GameManager>()); } }
|
||||
public static GameManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
return _instance ?? (_instance = new GameObject("GameManager").AddComponent<GameManager>());
|
||||
}
|
||||
}
|
||||
|
||||
private HUDManager hm;
|
||||
private BikeManager bm1;
|
||||
private BikeManager bm2;
|
||||
|
||||
private States _status;
|
||||
public States Status {get {return _status;} }
|
||||
private States _status;
|
||||
public States Status { get { return _status; } }
|
||||
|
||||
public HighscoreEntry EntryP1 = new HighscoreEntry { time = new TimeSpan(0, 0, 0, 28, 20) };
|
||||
public HighscoreEntry EntryP2 = new HighscoreEntry { time = new TimeSpan(0, 0, 0, 40, 20) };
|
||||
|
||||
// Skins of the two players
|
||||
private int[] _skins = new int[2];
|
||||
|
||||
private ConfigurationLoader conf;
|
||||
|
||||
private void Awake(){
|
||||
private void Awake()
|
||||
{
|
||||
// Singleton
|
||||
if (_instance != null && _instance != this) {
|
||||
if (_instance != null && _instance != this)
|
||||
{
|
||||
Debug.Log("WARNING: Other instance of GameManager found.");
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_instance = this;
|
||||
_instance = this;
|
||||
|
||||
// Don't destroy when loading new scene
|
||||
DontDestroyOnLoad(transform.gameObject);
|
||||
|
||||
conf = new ConfigurationLoader();
|
||||
|
||||
_status = States.Menu;
|
||||
_status = States.Menu;
|
||||
|
||||
// TODO: Load Menu
|
||||
// TODO: Load Menu
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
private void Start()
|
||||
{
|
||||
// Quick Check
|
||||
if (hm == null)
|
||||
Debug.Log("ERROR: HUDManager not registered.");
|
||||
@ -60,18 +102,21 @@ public class GameManager : MonoBehaviour {
|
||||
Debug.Log("ERROR: BikeManager P2 not registered.");
|
||||
}
|
||||
|
||||
public void RegisterBike(BikeManager bike, int bikeID) {
|
||||
public void RegisterBike(BikeManager bike, int bikeID)
|
||||
{
|
||||
if (bikeID == 0)
|
||||
bm1 = bike;
|
||||
if (bikeID == 1)
|
||||
bm2 = bike;
|
||||
}
|
||||
|
||||
public void RegisterHUD(HUDManager hud) {
|
||||
public void RegisterHUD(HUDManager hud)
|
||||
{
|
||||
hm = hud;
|
||||
}
|
||||
|
||||
public BikeManager GetBikeManager(int bikeID) {
|
||||
public BikeManager GetBikeManager(int bikeID)
|
||||
{
|
||||
if (bikeID == 0)
|
||||
return bm1;
|
||||
if (bikeID == 1)
|
||||
@ -79,96 +124,133 @@ public class GameManager : MonoBehaviour {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Hello() {
|
||||
public void Hello()
|
||||
{
|
||||
Debug.Log("Hello!");
|
||||
}
|
||||
|
||||
public float GetRaceDistance() {
|
||||
public float GetRaceDistance()
|
||||
{
|
||||
return conf.distance;
|
||||
}
|
||||
|
||||
public float GetRaceNormalTime() {
|
||||
public float GetRaceNormalTime()
|
||||
{
|
||||
return conf.normalTime;
|
||||
}
|
||||
|
||||
public float GetBikeWheelDiameter(int bikeID) {
|
||||
public float GetBikeWheelDiameter(int bikeID)
|
||||
{
|
||||
return conf.diameters[bikeID];
|
||||
}
|
||||
|
||||
public int GetSensorsCount(int bikeID) {
|
||||
public int GetSensorsCount(int bikeID)
|
||||
{
|
||||
return conf.sensors[bikeID];
|
||||
}
|
||||
|
||||
public float GetVideoEnd(int videoID) {
|
||||
return conf.videoEnds[videoID];
|
||||
}
|
||||
public float GetVideoEnd(int videoID)
|
||||
{
|
||||
return conf.videoEnds[videoID];
|
||||
}
|
||||
|
||||
public void SetSkins(int player1, int player2) {
|
||||
public void SetSkins(int player1, int player2)
|
||||
{
|
||||
_skins[0] = player1;
|
||||
_skins[1] = player2;
|
||||
}
|
||||
|
||||
public int GetSkins(int playerID) {
|
||||
public int GetSkins(int playerID)
|
||||
{
|
||||
return _skins[playerID];
|
||||
}
|
||||
|
||||
// TODO: Remove once menus are ok
|
||||
void Update() {
|
||||
if (Input.GetButtonDown("SubmitP1")) {
|
||||
SetSkins(0, 1);
|
||||
LaunchRace();
|
||||
}
|
||||
// TODO: Remove once menus are ok
|
||||
void Update()
|
||||
{
|
||||
//if (Input.GetButtonDown("SubmitP1"))
|
||||
//{
|
||||
// SetSkins(0, 1);
|
||||
// LaunchRace();
|
||||
//}
|
||||
|
||||
if (_status == States.LoadingVideo) {
|
||||
Debug.Log(bm1.LoadingComplete() + " " + bm2.LoadingComplete());
|
||||
if (bm1.LoadingComplete() && bm2.LoadingComplete()) {
|
||||
Debug.Log("Videos are set up and ready to go!");
|
||||
_status = States.RaceSetup;
|
||||
StartCoroutine(SetupRace());
|
||||
}
|
||||
}
|
||||
if (_status == States.LoadingVideo)
|
||||
{
|
||||
Debug.Log(bm1.LoadingComplete() + " " + bm2.LoadingComplete());
|
||||
if (bm1.LoadingComplete() && bm2.LoadingComplete())
|
||||
{
|
||||
Debug.Log("Videos are set up and ready to go!");
|
||||
_status = States.RaceSetup;
|
||||
StartCoroutine(SetupRace());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void LaunchRace() {
|
||||
_status = States.LoadingScene;
|
||||
StartCoroutine(LoadGameScene());
|
||||
}
|
||||
public void LaunchRace()
|
||||
{
|
||||
_status = States.LoadingScene;
|
||||
StartCoroutine(LoadGameScene());
|
||||
}
|
||||
|
||||
void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode) {
|
||||
if (_status == States.LoadingScene) {
|
||||
Debug.Log("Loading videos");
|
||||
_status = States.LoadingVideo;
|
||||
}
|
||||
}
|
||||
public void DisplayMenu()
|
||||
{
|
||||
_status = States.Menu;
|
||||
StartCoroutine(LoadMenuScene());
|
||||
}
|
||||
|
||||
void OnEnable() {
|
||||
SceneManager.sceneLoaded += OnLevelFinishedLoading;
|
||||
}
|
||||
void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
if (_status == States.LoadingScene)
|
||||
{
|
||||
Debug.Log("Loading videos");
|
||||
_status = States.LoadingVideo;
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
SceneManager.sceneLoaded -= OnLevelFinishedLoading;
|
||||
}
|
||||
void OnEnable()
|
||||
{
|
||||
SceneManager.sceneLoaded += OnLevelFinishedLoading;
|
||||
}
|
||||
|
||||
IEnumerator SetupRace() {
|
||||
hm.loadingScreens.SetActive(false);
|
||||
hm.SetMessageActive(false);
|
||||
// Timer
|
||||
//yield return new WaitForSeconds(3f);
|
||||
hm.SetMessageActive(true);
|
||||
hm.SetMessage("Prêts ?");
|
||||
// Timer
|
||||
yield return new WaitForSeconds(2f);
|
||||
hm.SetMessage("Pédalez !");
|
||||
_status = States.Race;
|
||||
// Timer
|
||||
yield return new WaitForSeconds(1f);
|
||||
hm.SetMessageActive(false);
|
||||
}
|
||||
void OnDisable()
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnLevelFinishedLoading;
|
||||
}
|
||||
|
||||
IEnumerator SetupRace()
|
||||
{
|
||||
hm.loadingScreens.SetActive(false);
|
||||
hm.SetMessageActive(false);
|
||||
// Timer
|
||||
//yield return new WaitForSeconds(3f);
|
||||
hm.SetMessageActive(true);
|
||||
hm.SetMessage("Prêts ?");
|
||||
// Timer
|
||||
yield return new WaitForSeconds(2f);
|
||||
hm.SetMessage("Pédalez !");
|
||||
_status = States.Race;
|
||||
// Timer
|
||||
yield return new WaitForSeconds(1f);
|
||||
hm.SetMessageActive(false);
|
||||
}
|
||||
|
||||
|
||||
IEnumerator LoadGameScene() {
|
||||
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync("GameScene");
|
||||
IEnumerator LoadGameScene()
|
||||
{
|
||||
return LoadScene(GameSceneName);
|
||||
}
|
||||
|
||||
IEnumerator LoadMenuScene()
|
||||
{
|
||||
return LoadScene(MenuSceneName);
|
||||
}
|
||||
|
||||
IEnumerator LoadScene(string sceneName)
|
||||
{
|
||||
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(sceneName);
|
||||
while (!asyncLoad.isDone)
|
||||
yield return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,15 +3,16 @@ using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class HighscoreLetterManager : MonoBehaviour
|
||||
public class HighscoreLetterManager : BaseInputBehavior
|
||||
{
|
||||
private string[] Alphanumerics = new[]
|
||||
private List<string> Alphanumerics = new List<string>
|
||||
{
|
||||
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
|
||||
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
|
||||
"U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3",
|
||||
"4", "5", "6", "7", "8", "9"
|
||||
"4", "5", "6", "7", "8", "9", " "
|
||||
};
|
||||
public bool IsActive
|
||||
{
|
||||
@ -23,44 +24,44 @@ public class HighscoreLetterManager : MonoBehaviour
|
||||
{
|
||||
if (value == _isActive) return;
|
||||
_isActive = value;
|
||||
Selector.GetComponent<Image>().color = _isActive ? ColorSelection : Color.clear;
|
||||
var image = Selector.GetComponent<Image>();
|
||||
var test = Selector.GetComponentInChildren<Image>();
|
||||
UpdateButtons();
|
||||
//var image = Selector.GetComponent<Image>();
|
||||
//var test = Selector.GetComponentInChildren<Image>();
|
||||
}
|
||||
}
|
||||
|
||||
private int currentIndex;
|
||||
|
||||
public Button UpButton;
|
||||
public Sprite UpButtonSprite;
|
||||
public Sprite PressedUpButtonSprite;
|
||||
//public Sprite UpButtonSprite;
|
||||
//public Sprite PressedUpButtonSprite;
|
||||
|
||||
public Button DownButton;
|
||||
public Sprite DownButtonSprite;
|
||||
public Sprite PressedDownButtonSprite;
|
||||
//public Sprite DownButtonSprite;
|
||||
//public Sprite PressedDownButtonSprite;
|
||||
|
||||
public Text LetterText;
|
||||
|
||||
public GameObject Selector;
|
||||
public Color ColorSelection;
|
||||
//public GameObject Selector;
|
||||
//public Color ColorSelection;
|
||||
|
||||
//public string XAxis;
|
||||
public string YAxis;
|
||||
public string YAxis { get { return !Player2 ? GameManager.Instance.YAxisP1 : GameManager.Instance.YAxisP2; } }
|
||||
|
||||
private Image upButtonImage;
|
||||
private Image downButtonImage;
|
||||
private bool letterIsChanging;
|
||||
private bool upButtonPressed;
|
||||
private bool downButtonPressed;
|
||||
private DateTime lastInput;
|
||||
public int InputDelay = 500;
|
||||
//private DateTime lastInput;
|
||||
//public int InputDelay = 500;
|
||||
private bool _isActive;
|
||||
|
||||
|
||||
bool IsSpawned
|
||||
{
|
||||
get { return lastInput == null || (DateTime.Now - lastInput).Milliseconds < InputDelay; }
|
||||
}
|
||||
//bool IsSpawned
|
||||
//{
|
||||
// get { return lastInput == null || (DateTime.Now - lastInput).Milliseconds < InputDelay; }
|
||||
//}
|
||||
|
||||
public string CurrentText
|
||||
{ get { return Alphanumerics[CurrentIndex]; } }
|
||||
@ -78,14 +79,17 @@ public class HighscoreLetterManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public bool Player2 { get; internal set; }
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
CurrentIndex = 0;
|
||||
if (Alphanumerics.Contains(LetterText.text))
|
||||
CurrentIndex = Alphanumerics.IndexOf(LetterText.text);
|
||||
upButtonImage = UpButton.GetComponentInChildren<Image>();
|
||||
downButtonImage = DownButton.GetComponentInChildren<Image>();
|
||||
if (Selector != null)
|
||||
Selector.GetComponent<Image>().color = _isActive ? ColorSelection : Color.clear;
|
||||
UpdateButtons();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@ -113,25 +117,28 @@ public class HighscoreLetterManager : MonoBehaviour
|
||||
{
|
||||
LetterText.text = CurrentText;
|
||||
}
|
||||
UpdateButtonsSprite();
|
||||
////////////////UpdateButtons();
|
||||
}
|
||||
|
||||
private void UpdateButtonsSprite()
|
||||
private void UpdateButtons()
|
||||
{
|
||||
var upSprite = UpButtonSprite;
|
||||
var downSprite = DownButtonSprite;
|
||||
if (upButtonPressed && (DateTime.Now - lastInput).Milliseconds < 200)
|
||||
{
|
||||
upSprite = PressedUpButtonSprite;
|
||||
}
|
||||
else upButtonPressed = false;
|
||||
if (downButtonPressed && (DateTime.Now - lastInput).Milliseconds < 200)
|
||||
{
|
||||
downSprite = PressedDownButtonSprite;
|
||||
}
|
||||
else downButtonPressed = false;
|
||||
upButtonImage.sprite = upSprite;
|
||||
downButtonImage.sprite = downSprite;
|
||||
//var upSprite = UpButtonSprite;
|
||||
//var downSprite = DownButtonSprite;
|
||||
//if (upButtonPressed && (DateTime.Now - lastInput).Milliseconds < 200)
|
||||
//{
|
||||
// upSprite = PressedUpButtonSprite;
|
||||
//}
|
||||
//else upButtonPressed = false;
|
||||
//if (downButtonPressed && (DateTime.Now - lastInput).Milliseconds < 200)
|
||||
//{
|
||||
// downSprite = PressedDownButtonSprite;
|
||||
//}
|
||||
//else downButtonPressed = false;
|
||||
//upButtonImage.sprite = upSprite;
|
||||
//downButtonImage.sprite = downSprite;
|
||||
Debug.Log(transform.gameObject.name + " is " + (_isActive ? "active" : "inactive"));
|
||||
upButtonImage.gameObject.SetActive(_isActive);
|
||||
downButtonImage.gameObject.SetActive(_isActive);
|
||||
}
|
||||
|
||||
public void ChangeLetter(bool plus)
|
||||
@ -151,8 +158,8 @@ public class HighscoreLetterManager : MonoBehaviour
|
||||
CurrentIndex--;
|
||||
downButtonPressed = true;
|
||||
}
|
||||
if (CurrentIndex < 0) CurrentIndex = Alphanumerics.Length - 1;
|
||||
else if (CurrentIndex >= Alphanumerics.Length) CurrentIndex = 0;
|
||||
if (CurrentIndex < 0) CurrentIndex = Alphanumerics.Count - 1;
|
||||
else if (CurrentIndex >= Alphanumerics.Count) CurrentIndex = 0;
|
||||
letterIsChanging = false;
|
||||
}
|
||||
|
||||
|
@ -1,73 +0,0 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class HighscoreLettersManager : MonoBehaviour
|
||||
{
|
||||
private DateTime lastInput;
|
||||
public int InputDelay = 150;
|
||||
public GameObject[] Letters;
|
||||
public Text ResultText;
|
||||
public string XAxis;
|
||||
public int rank;
|
||||
public TimeSpan RunTime = new TimeSpan(0,0,1,30,500);
|
||||
|
||||
private int _selectionIndex = 0;
|
||||
private bool selectionChanging;
|
||||
|
||||
bool IsSpawned
|
||||
{
|
||||
get { return lastInput == null || (DateTime.Now - lastInput).Milliseconds < InputDelay; }
|
||||
}
|
||||
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
if (Letters != null && Letters.Any())
|
||||
Letters[0].GetComponent<HighscoreLetterManager>().IsActive = true;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (ResultText != null)
|
||||
ResultText.text = UpdateText();
|
||||
if (!IsSpawned || selectionChanging)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(XAxis))
|
||||
{
|
||||
var axis = Input.GetAxis(XAxis);
|
||||
if (Math.Abs(axis) == 1)
|
||||
ChangeSelection(axis == 1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeSelection(bool toRight)
|
||||
{
|
||||
selectionChanging = true;
|
||||
lastInput = DateTime.Now;
|
||||
var oldSelection = _selectionIndex;
|
||||
if (toRight) _selectionIndex++;
|
||||
else _selectionIndex--;
|
||||
if (_selectionIndex < 0) _selectionIndex = Letters.Length - 1;
|
||||
else if (_selectionIndex >= Letters.Length) _selectionIndex = 0;
|
||||
Letters[oldSelection].GetComponent<HighscoreLetterManager>().IsActive = false;
|
||||
Letters[_selectionIndex].GetComponent<HighscoreLetterManager>().IsActive = true;
|
||||
selectionChanging = false;
|
||||
}
|
||||
|
||||
|
||||
private string UpdateText()
|
||||
{
|
||||
var pseudo = string.Empty;
|
||||
foreach (var letter in Letters)
|
||||
pseudo += letter.GetComponentInChildren<Text>().text;
|
||||
|
||||
return string.Format("{0}/ - \t{1}\t - {2}:{3}:{4}", rank, pseudo, RunTime.Minutes, RunTime.Seconds, RunTime.Milliseconds);
|
||||
}
|
||||
}
|
124
Assets/Scripts/HighscoreRecordMenuManager.cs
Normal file
124
Assets/Scripts/HighscoreRecordMenuManager.cs
Normal file
@ -0,0 +1,124 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class HighscoreRecordMenuManager : BaseInputBehavior
|
||||
{
|
||||
public GameObject[] Letters;
|
||||
public Text PseudoText;
|
||||
public Text TimeText;
|
||||
public Image TransportImage;
|
||||
public string XAxisName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.XAxisP1 : GameManager.Instance.XAxisP2; }
|
||||
}
|
||||
public string YAxisName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.YAxisP1 : GameManager.Instance.YAxisP2; }
|
||||
}
|
||||
public string SubmitButtonName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.SubmitP1 : GameManager.Instance.SubmitP2; }
|
||||
}
|
||||
public string CancelButtonName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.CancelP2 : GameManager.Instance.CancelP2; }
|
||||
}
|
||||
public int rank;
|
||||
public TimeSpan RunTime = new TimeSpan(0, 0, 1, 30, 500);
|
||||
|
||||
public bool Player2;
|
||||
|
||||
private int _selectionIndex = 0;
|
||||
private bool selectionChanging;
|
||||
|
||||
|
||||
|
||||
public HighscoreEntry Entry { get; private set; }
|
||||
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
if (Letters != null && Letters.Any())
|
||||
{
|
||||
var manager = Letters[0].GetComponent<HighscoreLetterManager>();
|
||||
manager.IsActive = true;
|
||||
manager.Player2 = Player2;
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (PseudoText != null)
|
||||
PseudoText.text = GetPseudo();
|
||||
if (TransportImage != null && Entry != null && GameManager.Instance.Transports != null && Entry.transport < GameManager.Instance.Transports.Count)
|
||||
TransportImage.sprite = GameManager.Instance.Transports[Entry.transport];
|
||||
if (TimeText != null)
|
||||
TimeText.text = Entry.timeStr;
|
||||
if (!IsSpawned || !selectionChanging)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(XAxisName))
|
||||
{
|
||||
var axis = Input.GetAxis(XAxisName);
|
||||
if (Math.Abs(axis) == 1)
|
||||
ChangeSelection(axis == 1);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(SubmitButtonName))
|
||||
{
|
||||
if (Input.GetButton(SubmitButtonName))
|
||||
{
|
||||
if (HighscoresManager.Current.IsANewRecord(Entry))
|
||||
{
|
||||
Entry.pseudo = GetPseudo();
|
||||
HighscoresManager.Current.AddNewEntry(Entry);
|
||||
}
|
||||
GameManager.Instance.DisplayMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
//on récupère le highscore du joueur
|
||||
Entry = Player2 ? GameManager.Instance.EntryP2 : GameManager.Instance.EntryP1;
|
||||
CheckEntry();
|
||||
}
|
||||
|
||||
private void CheckEntry()
|
||||
{
|
||||
if (!HighscoresManager.Current.IsANewRecord(Entry))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
GameManager.Instance.DisplayMenu();
|
||||
//TODO : Navigate to next screen
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeSelection(bool toRight)
|
||||
{
|
||||
selectionChanging = true;
|
||||
lastInput = DateTime.Now;
|
||||
var oldSelection = _selectionIndex;
|
||||
if (toRight) _selectionIndex++;
|
||||
else _selectionIndex--;
|
||||
if (_selectionIndex < 0) _selectionIndex = Letters.Length - 1;
|
||||
else if (_selectionIndex >= Letters.Length) _selectionIndex = 0;
|
||||
Letters[oldSelection].GetComponent<HighscoreLetterManager>().IsActive = false;
|
||||
Letters[_selectionIndex].GetComponent<HighscoreLetterManager>().IsActive = true;
|
||||
selectionChanging = false;
|
||||
}
|
||||
|
||||
|
||||
private string GetPseudo()
|
||||
{
|
||||
var pseudo = string.Empty;
|
||||
foreach (var letter in Letters)
|
||||
pseudo += letter.GetComponentInChildren<Text>().text;
|
||||
return pseudo;
|
||||
}
|
||||
}
|
@ -5,22 +5,33 @@ using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class HighscoresManager : MonoBehaviour
|
||||
public class HighscoresManager
|
||||
{
|
||||
public static HighscoresManager Current { get; private set; }
|
||||
private static HighscoresManager current;
|
||||
public static HighscoresManager Current
|
||||
{
|
||||
get
|
||||
{
|
||||
if (current == null) current = new HighscoresManager();
|
||||
return current;
|
||||
}
|
||||
private set
|
||||
{
|
||||
current = value;
|
||||
}
|
||||
}
|
||||
private string filename;
|
||||
public List<HighscoreEntry> Entries;
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
public HighscoresManager()
|
||||
{
|
||||
filename = Application.streamingAssetsPath + "/highscores.json";
|
||||
Current = this;
|
||||
Entries = new List<HighscoreEntry>();
|
||||
LoadFile();
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
private void Init()
|
||||
{
|
||||
Entries.Clear();
|
||||
@ -38,6 +49,23 @@ public class HighscoresManager : MonoBehaviour
|
||||
LoadFile();
|
||||
}
|
||||
|
||||
internal void AddNewEntry(HighscoreEntry entry)
|
||||
{
|
||||
if (entry == null || Entries == null) return;
|
||||
if (IsANewRecord(entry))
|
||||
{
|
||||
Entries.Add(entry);
|
||||
SortEntries();
|
||||
Entries.Remove(Entries.Last());
|
||||
WriteFile();
|
||||
}
|
||||
}
|
||||
|
||||
internal bool IsANewRecord(HighscoreEntry highscore)
|
||||
{
|
||||
return Entries.Any(e => e.time > highscore.time);
|
||||
}
|
||||
|
||||
private void LoadFile()
|
||||
{
|
||||
HighscoreEntry[] entries;
|
||||
@ -47,10 +75,16 @@ public class HighscoresManager : MonoBehaviour
|
||||
{
|
||||
Entries.Clear();
|
||||
Entries.AddRange(entries);
|
||||
Entries = Entries.OrderBy(e => e.rank).ToList();
|
||||
SortEntries();
|
||||
}
|
||||
}
|
||||
|
||||
private void SortEntries()
|
||||
{
|
||||
Entries = Entries.OrderBy(e => e.time).ToList();
|
||||
Entries.ForEach(e => e.rank = Entries.IndexOf(e) + 1);
|
||||
}
|
||||
|
||||
private void WriteFile()
|
||||
{
|
||||
var entries = JsonHelper.ToJson(Entries.ToArray());
|
||||
@ -58,9 +92,11 @@ public class HighscoresManager : MonoBehaviour
|
||||
sr.WriteLine(entries);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class HighscoreEntry
|
||||
{
|
||||
[NonSerialized]
|
||||
public int rank;
|
||||
public string pseudo;
|
||||
public int transport;
|
||||
|
@ -8,16 +8,10 @@ using System.Linq;
|
||||
public class HighscoresUiManager : MonoBehaviour
|
||||
{
|
||||
public GameObject grid;
|
||||
public Sprite[] Transports;
|
||||
public List<GameObject> GridChildren;
|
||||
//public Sprite[] Transports;
|
||||
public List<GameObject> GridChildren = new List<GameObject>();
|
||||
private string prefabPath = "Prefab/RankPanel";
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
GridChildren = new List<GameObject>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
@ -25,8 +19,12 @@ public class HighscoresUiManager : MonoBehaviour
|
||||
FillGrid();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void FillGrid()
|
||||
{
|
||||
if (HighscoresManager.Current == null) return;
|
||||
@ -40,9 +38,12 @@ public class HighscoresUiManager : MonoBehaviour
|
||||
.text = entry.pseudo.ToString();
|
||||
texts.First(t => string.Equals(t.name, "time", StringComparison.InvariantCultureIgnoreCase))
|
||||
.text = entry.timeStr;
|
||||
var image = rankPanel.GetComponentsInChildren<Image>();
|
||||
image.FirstOrDefault().sprite = Transports[entry.transport];
|
||||
var images = rankPanel.GetComponentsInChildren<Image>();
|
||||
var image = images.FirstOrDefault(i => i.name == "Image");
|
||||
if (image != null) image.sprite = GameManager.Instance.Transports[entry.transport];
|
||||
else image.sprite = null;
|
||||
rankPanel.transform.SetParent(grid.transform, false);
|
||||
GridChildren.Add(rankPanel);
|
||||
//rankPanel.transform.parent = grid.transform;
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,9 @@ public class LaunchGameScript : MonoBehaviour
|
||||
if (Input.GetButton("SubmitP1") && Input.GetButton("SubmitP2") && go)
|
||||
{
|
||||
GoButton.GetComponentInChildren<Text>().text = "Launching...";
|
||||
new WaitForSeconds(2);
|
||||
Launching = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class LoadSceneOnClick : MonoBehaviour {
|
||||
|
||||
public void LoadByIndex(int sceneIndex)
|
||||
public void LoadByIndex(string sceneName)
|
||||
{
|
||||
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SelectorBehavior : MonoBehaviour
|
||||
public class SelectorBehavior : BaseInputBehavior
|
||||
{
|
||||
|
||||
#region private fields
|
||||
@ -26,12 +26,7 @@ public class SelectorBehavior : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private DateTime lastInput;
|
||||
|
||||
bool IsSpawned
|
||||
{
|
||||
get { return lastInput == null || (DateTime.Now - lastInput).Milliseconds < InputDelay; }
|
||||
}
|
||||
|
||||
|
||||
Transform CurrentTransport
|
||||
{
|
||||
@ -67,7 +62,7 @@ public class SelectorBehavior : MonoBehaviour
|
||||
public Image PlayerPanelImage;
|
||||
public Text PlayerPanelText;
|
||||
public bool Player2;
|
||||
public int InputDelay = 200;
|
||||
//public int InputDelay = 200;
|
||||
public int Padding;
|
||||
public Transform TransportsPanel;
|
||||
public Color NormalColor = new Color(235, 239, 179, 255);
|
||||
@ -75,10 +70,22 @@ public class SelectorBehavior : MonoBehaviour
|
||||
public Sprite SelectorImage;
|
||||
public Color SelectorColor;
|
||||
public Sprite SelectionImage;
|
||||
public string HorizontalAxisName;
|
||||
public string VerticalAxisName;
|
||||
public string SubmitButtonName;
|
||||
public string CancelButtonName;
|
||||
public string XAxisName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.XAxisP1 : GameManager.Instance.XAxisP2; }
|
||||
}
|
||||
public string YAxisName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.YAxisP1 : GameManager.Instance.YAxisP2; }
|
||||
}
|
||||
public string SubmitButtonName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.SubmitP1 : GameManager.Instance.SubmitP2; }
|
||||
}
|
||||
public string CancelButtonName
|
||||
{
|
||||
get { return !Player2 ? GameManager.Instance.CancelP2 : GameManager.Instance.CancelP2; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Behavior overrided methods
|
||||
@ -166,9 +173,9 @@ public class SelectorBehavior : MonoBehaviour
|
||||
private void HandleInputs()
|
||||
{
|
||||
if (IsSpawned || transports == null || LaunchGameScript.Current.Launching) return;
|
||||
if (!string.IsNullOrEmpty(VerticalAxisName) && !Selected)
|
||||
if (!string.IsNullOrEmpty(YAxisName) && !Selected)
|
||||
{
|
||||
var verticalAxis = Input.GetAxis(VerticalAxisName);
|
||||
var verticalAxis = Input.GetAxis(YAxisName);
|
||||
if (Math.Abs(verticalAxis) == 1)
|
||||
{
|
||||
bool? move = IsPositiveMove(verticalAxis);
|
||||
@ -178,9 +185,9 @@ public class SelectorBehavior : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(HorizontalAxisName) && !Selected)
|
||||
if (!string.IsNullOrEmpty(XAxisName) && !Selected)
|
||||
{
|
||||
var horizontalAxis = Input.GetAxis(HorizontalAxisName);
|
||||
var horizontalAxis = Input.GetAxis(XAxisName);
|
||||
if (Math.Abs(horizontalAxis) == 1)
|
||||
{
|
||||
bool? move = IsPositiveMove(horizontalAxis);
|
||||
|
@ -1 +1 @@
|
||||
{"Items":[{"rank":1,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":2,"pseudo":"Tata","transport":0,"timeStr":"0:30:30"},{"rank":3,"pseudo":"Titi","transport":0,"timeStr":"0:30:30"},{"rank":4,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":5,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":6,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":7,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":8,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":9,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"rank":10,"pseudo":"Toto","transport":0,"timeStr":"0:30:30"}]}
|
||||
{"Items":[{"pseudo":"PRENOM","transport":0,"timeStr":"0:28:20"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"pseudo":"Tata","transport":0,"timeStr":"0:30:30"},{"pseudo":"Titi","transport":0,"timeStr":"0:30:30"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"},{"pseudo":"Toto","transport":0,"timeStr":"0:30:30"}]}
|
||||
|
Loading…
Reference in New Issue
Block a user