diff --git a/Assets/Audio/Effects/Fox Death.mp3 b/Assets/Audio/Effects/Fox Death.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..0e3de4d87badec8c655516e06f0597d98d0cfc66 --- /dev/null +++ b/Assets/Audio/Effects/Fox Death.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6160ec7f75125bf589ac1f05c97a532a9e32bb715ee99bcc220c9c34b9aa2d3e +size 96480 diff --git a/Assets/Audio/Effects/Fox Death.mp3.meta b/Assets/Audio/Effects/Fox Death.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..fcdef44e6d2aa4d013b44faa347c47a7201c0e45 --- /dev/null +++ b/Assets/Audio/Effects/Fox Death.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 15795005290055148a4f871d6743ebed +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Effects/Fox Hurt.mp3 b/Assets/Audio/Effects/Fox Hurt.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..0971c629b994c816db0f7d4f9c92a8b58c23c465 --- /dev/null +++ b/Assets/Audio/Effects/Fox Hurt.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:937dfcff91c6d0cfb20be69d0e36de43620378f76de461741b91c75cef739321 +size 23520 diff --git a/Assets/Audio/Effects/Fox Hurt.mp3.meta b/Assets/Audio/Effects/Fox Hurt.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..3676103d9abd7142717d85716372a778181a5b92 --- /dev/null +++ b/Assets/Audio/Effects/Fox Hurt.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: e9057cb489cd8664392bb40886888078 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Effects/Lich Death.mp3 b/Assets/Audio/Effects/Lich Death.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..0179e2a063cda845a303e8689ca0d4c99715f73b --- /dev/null +++ b/Assets/Audio/Effects/Lich Death.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:656e873e8e2d392ab97a1612762168749a3d684d3254272231a443404c8cb17c +size 113280 diff --git a/Assets/Audio/Effects/Lich Death.mp3.meta b/Assets/Audio/Effects/Lich Death.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..1f35f4f26e070ae084b80e9cf25d07575ef8cb97 --- /dev/null +++ b/Assets/Audio/Effects/Lich Death.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: b56668ed1841d504cae8962fd1b5f0bc +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Effects/Lich Hurt.mp3 b/Assets/Audio/Effects/Lich Hurt.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f2d5e2c7e8954f2d0077fd789fc2f688822ec50a --- /dev/null +++ b/Assets/Audio/Effects/Lich Hurt.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8a22f388790f382e99278115e0e8dea1d67f615227bc33d49ccfb3964afe5d7 +size 31200 diff --git a/Assets/Audio/Effects/Lich Hurt.mp3.meta b/Assets/Audio/Effects/Lich Hurt.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..6da6ea1ea2f55e6ec9c34e5807dfe2b1a43ce226 --- /dev/null +++ b/Assets/Audio/Effects/Lich Hurt.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d09d008aa5c85ca42ad24a1f9486360f +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Models/Pet/_Prefab_Modified/PetFox.prefab b/Assets/Models/Pet/_Prefab_Modified/PetFox.prefab index e538b4127786a0d357d07172c1b40e09b652d7c7..3a762862af44ab862e170e17e9202412a3a618b5 100644 --- a/Assets/Models/Pet/_Prefab_Modified/PetFox.prefab +++ b/Assets/Models/Pet/_Prefab_Modified/PetFox.prefab @@ -142,6 +142,7 @@ GameObject: - component: {fileID: 2520437607838110581} - component: {fileID: 481786522} - component: {fileID: 481786523} + - component: {fileID: 6942621437326236798} m_Layer: 0 m_Name: PetFox m_TagString: Pet @@ -266,6 +267,7 @@ MonoBehaviour: startingHealth: 100 currentHealth: 0 armor: 0 + deathClip: {fileID: 8300000, guid: 15795005290055148a4f871d6743ebed, type: 3} --- !u!114 &481786523 MonoBehaviour: m_ObjectHideFlags: 0 @@ -278,8 +280,103 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 73ca3aed066e73d4ba99b5be157d7ba6, type: 3} m_Name: m_EditorClassIdentifier: - playerHealth: {fileID: 0} healDelay: 10 +--- !u!82 &6942621437326236798 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528693925922589003} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: e9057cb489cd8664392bb40886888078, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &1569683074598384135 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Models/Pet/_Prefab_Modified/PetLich.prefab b/Assets/Models/Pet/_Prefab_Modified/PetLich.prefab index 74aac7482f981f66a9104ad62f29260856a32b57..d318d2c6dab7e3282168dc2584db68453509c2c1 100644 --- a/Assets/Models/Pet/_Prefab_Modified/PetLich.prefab +++ b/Assets/Models/Pet/_Prefab_Modified/PetLich.prefab @@ -141,6 +141,7 @@ GameObject: - component: {fileID: 6649821425492048567} - component: {fileID: 9140073484006322690} - component: {fileID: 5237900790845583655} + - component: {fileID: 1710546516545906498} m_Layer: 0 m_Name: PetLich m_TagString: Pet @@ -253,6 +254,7 @@ MonoBehaviour: startingHealth: 100 currentHealth: 0 armor: 0 + deathClip: {fileID: 8300000, guid: b56668ed1841d504cae8962fd1b5f0bc, type: 3} --- !u!114 &9140073484006322690 MonoBehaviour: m_ObjectHideFlags: 0 @@ -277,6 +279,102 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 053db511ffac0464d8aeecd15ba793ac, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!82 &1710546516545906498 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 840075838095135235} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: d09d008aa5c85ca42ad24a1f9486360f, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &840114451401376633 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index a66d030c13121e0a78e52d712d245950d28c5b40..98409fa7562dbc7a874ee1fa5f08af296364d6ef 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -11300,6 +11300,18 @@ PrefabInstance: propertyPath: m_Text value: Save objectReference: {fileID: 0} + - target: {fileID: 11495182, guid: 1ea864171e6acaf46af1353b799103d7, type: 3} + propertyPath: m_Color.b + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11495182, guid: 1ea864171e6acaf46af1353b799103d7, type: 3} + propertyPath: m_Color.g + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 11495182, guid: 1ea864171e6acaf46af1353b799103d7, type: 3} + propertyPath: m_Color.r + value: 0 + objectReference: {fileID: 0} - target: {fileID: 22475538, guid: 1ea864171e6acaf46af1353b799103d7, type: 3} propertyPath: m_Pivot.x value: 0.5 diff --git a/Assets/Scenes/TestPetFox.unity b/Assets/Scenes/TestPetFox.unity index 989f3668ed6a0fc740fef42cf0964a8dd3eaee1c..3a4029a710ba71cae0d6f5437de79a87668ace17 100644 --- a/Assets/Scenes/TestPetFox.unity +++ b/Assets/Scenes/TestPetFox.unity @@ -6892,6 +6892,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6942621437326236798, guid: dd6262d61cba88e49b545d405f8fad99, type: 3} + propertyPath: m_PlayOnAwake + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: dd6262d61cba88e49b545d405f8fad99, type: 3} --- !u!1001 &1873354560 diff --git a/Assets/Scripts/Player/PlayerGold.cs b/Assets/Scripts/Player/PlayerGold.cs index 7876074fb5f4aae121f11504ba38903c9a4e804f..258af7d3d679a00c9ade11ef2fb63c53b740f33c 100644 --- a/Assets/Scripts/Player/PlayerGold.cs +++ b/Assets/Scripts/Player/PlayerGold.cs @@ -12,6 +12,11 @@ public class PlayerGold : MonoBehaviour return goldAmount; } + public void setGoldAmount(int goldAmount) + { + this.goldAmount = goldAmount; + } + public void increaseGoldAmount(int gold) { this.goldAmount += gold; diff --git a/Assets/Scripts/Quest/QuestManager.cs b/Assets/Scripts/Quest/QuestManager.cs index ede144a935b2a9a070530b2f45cb2afa03a2fc87..69afed134ae84de16f2ce9e116224a4ccaf1ca83 100644 --- a/Assets/Scripts/Quest/QuestManager.cs +++ b/Assets/Scripts/Quest/QuestManager.cs @@ -170,4 +170,10 @@ public class QuestManager : MonoBehaviour shop.SetActive(false); } + public void setQuestIdx(int questNum) + { + this.activeQuestIdx = questNum; + nextQuest(); + } + } diff --git a/Assets/Scripts/Save/SaveHandler.cs b/Assets/Scripts/Save/SaveHandler.cs index 6928f7016eec3eafa04a9407bff0040ed36dff24..b664879f8fc9532f5c6606e91d7b2d441604d9b7 100644 --- a/Assets/Scripts/Save/SaveHandler.cs +++ b/Assets/Scripts/Save/SaveHandler.cs @@ -84,14 +84,16 @@ public class SaveHandler : MonoBehaviour SaveManager.Save(slotIdx, saveName, SaveData.getSaveData()); } - public void OnLoadGame() + public void OnLoadGame(string fileName) { - SaveData data = (SaveData)SaveManager.Load("save1"); - Debug.Log(data.questIdx); - if (SceneManager.GetActiveScene().name != "Level_01") - { - SceneManager.LoadScene("Level_01"); - } + GameObject player = GameObject.FindGameObjectWithTag("Player"); + QuestManager questManager = GetComponent<QuestManager>(); + SaveData data = (SaveData)SaveManager.Load(fileName); + player.transform.position = data.playerPosition; + player.transform.rotation = data.playerRotation; + player.GetComponent<PlayerHealth>().currentHealth = data.playerHealth; + player.GetComponent<PlayerGold>().setGoldAmount(data.goldAmount); + questManager.setQuestIdx(data.questIdx); } public Dictionary<int, Tuple<string, DateTime>> preprocessFileName(string[] files_str) @@ -114,4 +116,35 @@ public class SaveHandler : MonoBehaviour } return files; } + + public bool loadLastSave() + { + if (!Directory.Exists(Application.persistentDataPath + "/save/")) + { + Directory.CreateDirectory(Application.persistentDataPath + "/save/"); + } + + string[] files_str = Directory.GetFiles(Application.persistentDataPath + "/save/"); + + if (files_str.Length == 0) + { + return false; + } + + string latestFile = files_str[0]; + DateTime saveTime = new FileInfo(latestFile).LastWriteTime; + for (int i=1; i<files_str.Length; i++) + { + DateTime curSaveTime = new FileInfo(files_str[i]).LastWriteTime; + if (curSaveTime > saveTime) + { + saveTime = curSaveTime; + latestFile = files_str[i]; + } + } + + OnLoadGame(latestFile.Replace(Application.persistentDataPath + "/save/", "").Replace(".sshooter", "")); + + return true; + } }