From f45f7b466fe553fd3651dac8daf6175f4bf8dd43 Mon Sep 17 00:00:00 2001 From: reynull <13519045@std.stei.itb.ac.id> Date: Sat, 15 Apr 2023 15:53:39 +0700 Subject: [PATCH] fix bug on saving --- Assets/Prefabs/Shop.prefab | 11 +- Assets/Scenes/Level_01.unity | 118 ++++++++++++++++++---- Assets/Scripts/Save/SaveMenuController.cs | 1 + Assets/Scripts/Save/TabbedMenu.uxml | 4 +- Assets/Scripts/Shop/ShopSpawn.cs | 5 +- Assets/customsave.cssav | Bin 784 -> 864 bytes 6 files changed, 113 insertions(+), 26 deletions(-) diff --git a/Assets/Prefabs/Shop.prefab b/Assets/Prefabs/Shop.prefab index ce2036dc..6f162e93 100644 --- a/Assets/Prefabs/Shop.prefab +++ b/Assets/Prefabs/Shop.prefab @@ -522,21 +522,21 @@ AudioSource: m_GameObject: {fileID: 4160127699956994035} m_Enabled: 1 serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 24300001, guid: 5b84db49d40ea449aa4f3e3bd229ab5b, type: 2} + OutputAudioMixerGroup: {fileID: 24300001, guid: 8434b04884c414ac6b468e10945685e6, type: 2} m_audioClip: {fileID: 8300000, guid: 05cb51766bd043044951dfdece839bc6, type: 3} m_PlayOnAwake: 1 - m_Volume: 1 + m_Volume: 0.602 m_Pitch: 1 - Loop: 1 + Loop: 0 Mute: 0 Spatialize: 0 SpatializePostEffects: 0 Priority: 128 DopplerLevel: 1 MinDistance: 1 - MaxDistance: 500 + MaxDistance: 20 Pan2D: 0 - rolloffMode: 1 + rolloffMode: 0 BypassEffects: 0 BypassListenerEffects: 0 BypassReverbZones: 0 @@ -748,6 +748,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ShopModel: {fileID: 4160127699956994035} + ShopSpawner: {fileID: 7137542289196247827} --- !u!1 &8836449725484051236 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index f2a654ec..629956b0 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -25278,23 +25278,6 @@ 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 @@ -48918,6 +48901,107 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2087062120} m_Mesh: {fileID: 2534964839176971238, guid: f93eab62ea9bae546a47034341e32324, type: 3} +--- !u!1 &2089575848 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4160127699956994035, guid: 9f4287f0448cadc4884d8659dd50dcfb, type: 3} + m_PrefabInstance: {fileID: 5827184748629873689} + m_PrefabAsset: {fileID: 0} +--- !u!82 &2089575855 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089575848} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 12 + 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!1001 &2090455100 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Save/SaveMenuController.cs b/Assets/Scripts/Save/SaveMenuController.cs index beac37f4..cfa0cd67 100644 --- a/Assets/Scripts/Save/SaveMenuController.cs +++ b/Assets/Scripts/Save/SaveMenuController.cs @@ -55,6 +55,7 @@ public class SaveMenuController : MonoBehaviour tempTitle = getSlotTitle(slot); tempSlot = slot; slot[0].focusable = true; + slot[0].Focus(); } private void PromptConfirmation(BlurEvent evt, VisualElement slot) diff --git a/Assets/Scripts/Save/TabbedMenu.uxml b/Assets/Scripts/Save/TabbedMenu.uxml index 823b5b3e..73f14f1e 100644 --- a/Assets/Scripts/Save/TabbedMenu.uxml +++ b/Assets/Scripts/Save/TabbedMenu.uxml @@ -14,13 +14,13 @@ <ui:TextField picking-mode="Ignore" text="Save Slot 2" name="slotTitle" is-delayed="false" max-length="15" focusable="true" class="slotTitle slotTitleInput TextField" style="width: 100%;" /> <ui:Label display-tooltip-when-elided="true" name="slotDate" enable-rich-text="false" class="slot-date" /> <ui:Label display-tooltip-when-elided="true" name="finishedQuest" enable-rich-text="false" class="finished-quest" /> - <ui:Label text="1" display-tooltip-when-elided="true" name="slotNumber" style="display: none; visibility: visible;" /> + <ui:Label text="2" display-tooltip-when-elided="true" name="slotNumber" style="display: none; visibility: visible;" /> </ui:VisualElement> <ui:VisualElement name="card" class="card" style="padding-left: 5px; padding-right: 5px; padding-top: 5px; padding-bottom: 5px; color: rgb(255, 18, 18); transition-property: scale; transition-timing-function: linear; transition-duration: 0.1s; justify-content: space-around; align-items: center; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; border-top-left-radius: 20px; border-bottom-left-radius: 20px; border-top-right-radius: 20px; border-bottom-right-radius: 20px;"> <ui:TextField picking-mode="Ignore" text="Save Slot 3" name="slotTitle" is-delayed="false" max-length="15" focusable="true" class="slotTitle slotTitleInput TextField" style="width: 100%;" /> <ui:Label display-tooltip-when-elided="true" name="slotDate" enable-rich-text="false" class="slot-date" /> <ui:Label display-tooltip-when-elided="true" name="finishedQuest" enable-rich-text="false" class="finished-quest" /> - <ui:Label text="1" display-tooltip-when-elided="true" name="slotNumber" style="display: none; visibility: visible;" /> + <ui:Label text="3" display-tooltip-when-elided="true" name="slotNumber" style="display: none; visibility: visible;" /> </ui:VisualElement> </ui:VisualElement> <ui:VisualElement name="PromptConfirmation" focusable="false" style="display: none; position: absolute; width: 100%; height: 100%; opacity: 0.71; background-image: url('project://database/Assets/Textures/_opacity.jpg?fileID=2800000&guid=44884c03736864560a55f7f08709bd01&type=3#_opacity'); -unity-background-image-tint-color: rgb(0, 0, 0); justify-content: center; align-items: center;"> diff --git a/Assets/Scripts/Shop/ShopSpawn.cs b/Assets/Scripts/Shop/ShopSpawn.cs index be33b6dd..b0653177 100644 --- a/Assets/Scripts/Shop/ShopSpawn.cs +++ b/Assets/Scripts/Shop/ShopSpawn.cs @@ -8,10 +8,11 @@ public class ShopSpawn : MonoBehaviour private float shopSpawnTime; private bool isShown = false; public GameObject ShopModel; + public GameObject ShopSpawner; // Start is called before the first frame update void Start() { - shopSpawnTime = Random.Range(15,25); + shopSpawnTime = Random.Range(30,40); } // Update is called once per frame @@ -22,7 +23,7 @@ public class ShopSpawn : MonoBehaviour { isShown = true; ShopModel.SetActive(true); - Destroy(this); + Destroy(ShopSpawner); } } } diff --git a/Assets/customsave.cssav b/Assets/customsave.cssav index 22b95d434d83fc3de420fe1f4e3dfebe0fcf3f30..987fa24e8fe2944b0419fcb961c8fc73b886457c 100644 GIT binary patch literal 864 zcmV-m1E2iR5Ot`$G(}gjE!|P!dyl*3LKudS*q$7S5|)-v-~vxlN(C|1F1a<nzDY_K zPuOgCp<)IVBA3b^>~XX&2Okg0_!}s9vI!UjZ*=E|Nzn}f7I}l>sWVCZ{z^f>oEop{ zVj*L!>m}X*&s21+l`b~A1LNv}&JJs-+amf5@XHwZoBv@>XJ>n_Em%bN9HaN?9~5%p z<i75Mfpws#muyp~`d4Hw^K^Jwu;<EfFOU(*j=~De%|;A<@#7PGZdQqP|0LWv<}Nyq z7rD)GRcMX$Y5)zlv$vd+{!W16ZW}uTP@~ojQn;h`5<^e6&w>Ol)V;rdQaLsfbTp%} z^3F@O@paKJ&%16|WuEb6`eY~fb<>2rqd-lMW(`4M<-uV-L3o))o%yx(6E?2HUUJ<= z4&7#jf;<wmlkd=V7?T1oz}d>J*mG^E@Zz~yi<e&mO3@da*h?pmOQ|*uYxf^rMe9r` z-&Cw_6>U`o2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