diff --git a/Assets/Audio/Effects/Shop Audio.mp3 b/Assets/Audio/Effects/Shop Audio.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..89f529e8220f9e6c90394516ef82195011f7d272 --- /dev/null +++ b/Assets/Audio/Effects/Shop Audio.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a04519d39878a83d672eec657d62f97a49a78184b3d148a0eaba7437af92b2a9 +size 66174 diff --git a/Assets/Audio/Effects/Shop Audio.mp3.meta b/Assets/Audio/Effects/Shop Audio.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..f139b3af1274689601760f823e31bf9fb103bd9c --- /dev/null +++ b/Assets/Audio/Effects/Shop Audio.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 05cb51766bd043044951dfdece839bc6 +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/Prefabs/Shop.prefab b/Assets/Prefabs/Shop.prefab index 6f0c0a8c8f27c6ce203519645fa0daeab968eeca..ce2036dc0015830dded6fa7ffe192b9c6f6162e1 100644 --- a/Assets/Prefabs/Shop.prefab +++ b/Assets/Prefabs/Shop.prefab @@ -392,13 +392,14 @@ GameObject: - component: {fileID: 8663966551809835144} - component: {fileID: 5827184747890347642} - component: {fileID: 2955910647638027607} + - component: {fileID: 301039566598389285} m_Layer: 8 m_Name: ShopModel m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 1 m_StaticEditorFlags: 8 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &3670555426593920329 Transform: m_ObjectHideFlags: 0 @@ -512,6 +513,102 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} +--- !u!82 &301039566598389285 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4160127699956994035} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 24300001, guid: 5b84db49d40ea449aa4f3e3bd229ab5b, type: 2} + m_audioClip: {fileID: 8300000, guid: 05cb51766bd043044951dfdece839bc6, type: 3} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 1 + 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 &5827184749232656887 GameObject: m_ObjectHideFlags: 0 @@ -606,6 +703,51 @@ Light: m_UseViewFrustumForShadowCasterCull: 1 m_ShadowRadius: 0 m_ShadowAngle: 0 +--- !u!1 &7137542289196247827 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5640807028423008278} + - component: {fileID: 5023916051487981097} + m_Layer: 8 + m_Name: ShopSpawner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5640807028423008278 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7137542289196247827} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 732385392148688642} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5023916051487981097 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7137542289196247827} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee302440764eda940a231128500a53ff, type: 3} + m_Name: + m_EditorClassIdentifier: + ShopModel: {fileID: 4160127699956994035} --- !u!1 &8836449725484051236 GameObject: m_ObjectHideFlags: 0 @@ -637,6 +779,7 @@ Transform: m_Children: - {fileID: 3706613389833283421} - {fileID: 3670555426593920329} + - {fileID: 5640807028423008278} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index c6f82ad10bee7fada0a9984bcfa183496cf7b608..f2a654ecc8d4d60cfd5c95c021edc037ffd85671 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -25278,6 +25278,23 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 0.12, y: 0.5, z: 0.12} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &1096261168 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4674471357469637176, guid: 22631eaeabd21f54e8a9feb8cc6fc7b2, type: 3} + m_PrefabInstance: {fileID: 951586642} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1096261172 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1096261168} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee302440764eda940a231128500a53ff, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1102024337 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Managers/TimeElapsedManager.cs b/Assets/Scripts/Managers/TimeElapsedManager.cs index 9b37c06f129f4966699c8595e2c2a99f7504181a..d2ff4130c61ef007029f3764826844617396d961 100644 --- a/Assets/Scripts/Managers/TimeElapsedManager.cs +++ b/Assets/Scripts/Managers/TimeElapsedManager.cs @@ -11,9 +11,13 @@ public class TimeElapsedManager : MonoBehaviour public float currentTime; public Text currentTimeText; + private void Awake() { + currentTime = PersistentSceneData.passedTime; + } + void Start() { - currentTime = 0; + // currentTime = 0; setTimerOnOff(true); } diff --git a/Assets/Scripts/Player/PlayerMoney.cs b/Assets/Scripts/Player/PlayerMoney.cs index 162913cb92e606064d226faee85b9c440729cb22..7e3fa6fec91f1c6473f8b831f9b9a3edda899eb1 100644 --- a/Assets/Scripts/Player/PlayerMoney.cs +++ b/Assets/Scripts/Player/PlayerMoney.cs @@ -5,9 +5,14 @@ using UnityEngine.UI; public class PlayerMoney : MonoBehaviour { - private int currentMoney = 0; + private int currentMoney; public Text moneyText; + private void Awake() { + currentMoney = PersistentSceneData.money; + moneyText.text = "$" + currentMoney.ToString(); + } + public void AddMoney(int money) { if (CheatState.motherlodeState) diff --git a/Assets/Scripts/Shop/NewUI/ShopUIController.cs b/Assets/Scripts/Shop/NewUI/ShopUIController.cs index 6c840614c9961a9bd8f69599203642ffe4304606..44ab129f39b8460cc64ec155e991dc5db7dbff6c 100644 --- a/Assets/Scripts/Shop/NewUI/ShopUIController.cs +++ b/Assets/Scripts/Shop/NewUI/ShopUIController.cs @@ -28,13 +28,12 @@ public class ShopUIController : MonoBehaviour void BuyPet(ClickEvent evt, int index) { - if (!IsMoneyEnough(int.Parse(pets[index].Q<Label>("Price").text))) - { - return; - } - if (!PersistentSceneData.hasPets[index]){ // Add to Inventory (Buy) + if (!IsMoneyEnough(int.Parse(pets[index].Q<Label>("Price").text))) + { + return; + } PersistentSceneData.hasPets[index] = true; } else { // Activate the Pets diff --git a/Assets/Scripts/Shop/ShopSpawn.cs b/Assets/Scripts/Shop/ShopSpawn.cs new file mode 100644 index 0000000000000000000000000000000000000000..be33b6dd595d1fc69389ae66371a40660536dc44 --- /dev/null +++ b/Assets/Scripts/Shop/ShopSpawn.cs @@ -0,0 +1,28 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class ShopSpawn : MonoBehaviour +{ + private float timeStart = 0f; + private float shopSpawnTime; + private bool isShown = false; + public GameObject ShopModel; + // Start is called before the first frame update + void Start() + { + shopSpawnTime = Random.Range(15,25); + } + + // Update is called once per frame + void Update() + { + timeStart += Time.deltaTime; + if ((timeStart > shopSpawnTime) && !isShown) + { + isShown = true; + ShopModel.SetActive(true); + Destroy(this); + } + } +} diff --git a/Assets/Scripts/Shop/ShopSpawn.cs.meta b/Assets/Scripts/Shop/ShopSpawn.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..66e4e39f9594f241b0418a312eec0aaaf6e4da74 --- /dev/null +++ b/Assets/Scripts/Shop/ShopSpawn.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee302440764eda940a231128500a53ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: