diff --git a/Space Pioneers/Assets/Prefabs/LevelEnd.prefab b/Space Pioneers/Assets/Prefabs/LevelEnd.prefab index e11a96b..9e6c394 100644 --- a/Space Pioneers/Assets/Prefabs/LevelEnd.prefab +++ b/Space Pioneers/Assets/Prefabs/LevelEnd.prefab @@ -293,6 +293,80 @@ MonoBehaviour: m_BoolArgument: 0 m_CallState: 2 delay: 0 +--- !u!1 &1494276778 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1494276779} + - component: {fileID: 1494276781} + - component: {fileID: 1494276780} + m_Layer: 0 + m_Name: SaveLevel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1494276779 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1494276778} + 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: 1005717853658511761} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1494276781 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1494276778} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7edeac11724f50a418f5d69990d5c2eb, type: 3} + m_Name: + m_EditorClassIdentifier: + saveManager: {fileID: 11400000, guid: 049d360d519503249bf604cfea6aa877, type: 2} +--- !u!114 &1494276780 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1494276778} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bdaf8361ebb8d8a4199626f19e9c6d60, type: 3} + m_Name: + m_EditorClassIdentifier: + Event: {fileID: 11400000, guid: be56ebaddc8c22d48a34b54e33c2dc25, type: 2} + Response: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1494276781} + m_TargetAssemblyTypeName: SetLevelAsPlayed, Assembly-CSharp + m_MethodName: updateSave + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + delay: 0 --- !u!1 &1005717853658511773 GameObject: m_ObjectHideFlags: 0 @@ -306,9 +380,8 @@ GameObject: - component: {fileID: 1005717853658511763} - component: {fileID: 1005717853658511762} - component: {fileID: 2016981618} - - component: {fileID: 2071661773} - - component: {fileID: 2071661774} - component: {fileID: 2071661775} + - component: {fileID: 3097886037330270521} m_Layer: 0 m_Name: LevelEnd m_TagString: Untagged @@ -330,6 +403,7 @@ Transform: - {fileID: 451154458} - {fileID: 628444095} - {fileID: 700191035} + - {fileID: 1494276779} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -411,20 +485,7 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 126 m_CollisionDetection: 0 ---- !u!114 &2071661773 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1005717853658511773} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7edeac11724f50a418f5d69990d5c2eb, type: 3} - m_Name: - m_EditorClassIdentifier: - saveManager: {fileID: 11400000, guid: 049d360d519503249bf604cfea6aa877, type: 2} ---- !u!114 &2071661774 +--- !u!114 &2071661775 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -433,27 +494,13 @@ MonoBehaviour: m_GameObject: {fileID: 1005717853658511773} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bdaf8361ebb8d8a4199626f19e9c6d60, type: 3} + m_Script: {fileID: 11500000, guid: 5a7d60b5855b73a4294ad8682814f526, type: 3} m_Name: m_EditorClassIdentifier: - Event: {fileID: 11400000, guid: be56ebaddc8c22d48a34b54e33c2dc25, type: 2} - Response: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 2071661773} - m_TargetAssemblyTypeName: SetLevelAsPlayed, Assembly-CSharp - m_MethodName: setAsPlayed - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 - delay: 0 ---- !u!114 &2071661775 + targetObject: {fileID: 0} + eventToRaise: {fileID: 11400000, guid: be56ebaddc8c22d48a34b54e33c2dc25, type: 2} + fixOther: 1 +--- !u!114 &3097886037330270521 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -462,9 +509,7 @@ MonoBehaviour: m_GameObject: {fileID: 1005717853658511773} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5a7d60b5855b73a4294ad8682814f526, type: 3} + m_Script: {fileID: 11500000, guid: f55b778965b7e434692ec08be96b32dc, type: 3} m_Name: m_EditorClassIdentifier: - targetObject: {fileID: 0} - eventToRaise: {fileID: 11400000, guid: be56ebaddc8c22d48a34b54e33c2dc25, type: 2} - fixOther: 1 + saveManager: {fileID: 11400000, guid: 049d360d519503249bf604cfea6aa877, type: 2} diff --git a/Space Pioneers/Assets/Scripts/Save/SaveManager.asset b/Space Pioneers/Assets/Scripts/Save/SaveManager.asset index 5ad4e90..42c7ccf 100644 --- a/Space Pioneers/Assets/Scripts/Save/SaveManager.asset +++ b/Space Pioneers/Assets/Scripts/Save/SaveManager.asset @@ -14,6 +14,6 @@ MonoBehaviour: m_EditorClassIdentifier: currentSave: 0 saves: - - {fileID: 0} + - {fileID: 11400000, guid: 327a3867df6ad104f9b718ff7f800d7d, type: 2} - {fileID: 0} - {fileID: 0} diff --git a/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs b/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs index c806e11..a4ce72f 100644 --- a/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs +++ b/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs @@ -1,11 +1,16 @@ using UnityEngine; using UnityEngine.SceneManagement; -public class SetLevelAsPlayed : MonoBehaviour +public class UpdateSaveEndLevel : MonoBehaviour { [Tooltip("Game save manager.")][SerializeField] SaveManager saveManager; - public void setAsPlayed() + void Start() + { + Debug.Log("Teste"); + } + + public void updateSave() { if(saveManager.Save.last_played_level < SceneManager.GetActiveScene().buildIndex) { diff --git a/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs.meta b/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs.meta index c77b251..4a40fe6 100644 --- a/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs.meta +++ b/Space Pioneers/Assets/Scripts/Save/SetLevelAsPlayed.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7edeac11724f50a418f5d69990d5c2eb +guid: f2183fa80cd4b504fbed7ef2a45e1004 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Space Pioneers/Assets/Scripts/Save/UpdateSaveEndLevel.cs b/Space Pioneers/Assets/Scripts/Save/UpdateSaveEndLevel.cs new file mode 100644 index 0000000..a36af84 --- /dev/null +++ b/Space Pioneers/Assets/Scripts/Save/UpdateSaveEndLevel.cs @@ -0,0 +1,24 @@ +using UnityEngine; +using UnityEngine.SceneManagement; + +public class SetLevelAsPlayed : MonoBehaviour +{ + [Tooltip("Game save manager.")][SerializeField] SaveManager saveManager; + + void Start() + { + + } + + public void updateSave() + { + Debug.Log("Salvando"); + Debug.Log(saveManager.Save.last_played_level); + Debug.Log(SceneManager.GetActiveScene().buildIndex); + if(saveManager.Save.last_played_level < SceneManager.GetActiveScene().buildIndex) + { + Debug.Log("Salvando"); + saveManager.Save.last_played_level = SceneManager.GetActiveScene().buildIndex; + } + } +} \ No newline at end of file diff --git a/Space Pioneers/Assets/Scripts/Save/UpdateSaveEndLevel.cs.meta b/Space Pioneers/Assets/Scripts/Save/UpdateSaveEndLevel.cs.meta new file mode 100644 index 0000000..c77b251 --- /dev/null +++ b/Space Pioneers/Assets/Scripts/Save/UpdateSaveEndLevel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7edeac11724f50a418f5d69990d5c2eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: