From 8c933cc75aa04f76a57d51da876604f3f31f9104 Mon Sep 17 00:00:00 2001 From: KrolMel Date: Sat, 14 Jan 2023 22:38:58 +0100 Subject: [PATCH] Tombstone puzzle --- ...ave.unity => BossFightLabirynthCave.unity} | 0 ...meta => BossFightLabirynthCave.unity.meta} | 0 Assets/Scenes/Cementary.unity | 108 +++--------------- .../Scripts/REFACTORING/Story/Cementary.meta | 8 ++ .../Story/Cementary/TombstoneDoorBlock.cs | 45 ++++++++ .../Cementary/TombstoneDoorBlock.cs.meta | 11 ++ 6 files changed, 79 insertions(+), 93 deletions(-) rename Assets/Scenes/{FinalCave.unity => BossFightLabirynthCave.unity} (100%) rename Assets/Scenes/{FinalCave.unity.meta => BossFightLabirynthCave.unity.meta} (100%) create mode 100644 Assets/Scripts/REFACTORING/Story/Cementary.meta create mode 100644 Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs create mode 100644 Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs.meta diff --git a/Assets/Scenes/FinalCave.unity b/Assets/Scenes/BossFightLabirynthCave.unity similarity index 100% rename from Assets/Scenes/FinalCave.unity rename to Assets/Scenes/BossFightLabirynthCave.unity diff --git a/Assets/Scenes/FinalCave.unity.meta b/Assets/Scenes/BossFightLabirynthCave.unity.meta similarity index 100% rename from Assets/Scenes/FinalCave.unity.meta rename to Assets/Scenes/BossFightLabirynthCave.unity.meta diff --git a/Assets/Scenes/Cementary.unity b/Assets/Scenes/Cementary.unity index f3d864f8..d5514ad6 100644 --- a/Assets/Scenes/Cementary.unity +++ b/Assets/Scenes/Cementary.unity @@ -94503,6 +94503,7 @@ GameObject: - component: {fileID: 419250167} - component: {fileID: 419250166} - component: {fileID: 419250165} + - component: {fileID: 419250170} m_Layer: 0 m_Name: GatewayCatacombs m_TagString: SceneTransition @@ -94541,7 +94542,7 @@ MonoBehaviour: coords: {x: 0, y: 0, z: 0} nextMapName: Catacombs respawnCoords: {x: 0, y: -1, z: 0} - isEnabled: 1 + isEnabled: 0 --- !u!50 &419250167 Rigidbody2D: serializedVersion: 4 @@ -94603,6 +94604,19 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &419250170 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419250164} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 261dfaba248bb5644becedc6c832e3ca, type: 3} + m_Name: + m_EditorClassIdentifier: + bars: {fileID: 0} --- !u!1 &419616843 GameObject: m_ObjectHideFlags: 0 @@ -99259,7 +99273,6 @@ GameObject: - component: {fileID: 502298260} - component: {fileID: 502298262} - component: {fileID: 502298261} - - component: {fileID: 502298263} m_Layer: 0 m_Name: Tombstone2 m_TagString: Untagged @@ -99363,28 +99376,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!114 &502298263 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 502298259} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8d0c116465fe18f49addcc4e95a35f0c, type: 3} - m_Name: - m_EditorClassIdentifier: - position: - x: 0 - y: 0 - temp: {x: 0, y: 0, z: 0} - tombstone: tombstone7 - goal: - speed: 3 - pos: - m_ClipName: - player: {fileID: 0} --- !u!1 &507712396 GameObject: m_ObjectHideFlags: 0 @@ -108588,7 +108579,6 @@ GameObject: - component: {fileID: 680287735} - component: {fileID: 680287737} - component: {fileID: 680287736} - - component: {fileID: 680287738} m_Layer: 0 m_Name: Tombstone9 m_TagString: Untagged @@ -108692,28 +108682,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!114 &680287738 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 680287734} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8d0c116465fe18f49addcc4e95a35f0c, type: 3} - m_Name: - m_EditorClassIdentifier: - position: - x: 0 - y: 0 - temp: {x: 0, y: 0, z: 0} - tombstone: tombstone5 - goal: - speed: 3 - pos: - m_ClipName: - player: {fileID: 0} --- !u!1 &680989708 GameObject: m_ObjectHideFlags: 0 @@ -117826,7 +117794,6 @@ GameObject: - component: {fileID: 816566231} - component: {fileID: 816566233} - component: {fileID: 816566232} - - component: {fileID: 816566234} m_Layer: 0 m_Name: Tombstone4 m_TagString: Untagged @@ -117930,28 +117897,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!114 &816566234 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 816566230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8d0c116465fe18f49addcc4e95a35f0c, type: 3} - m_Name: - m_EditorClassIdentifier: - position: - x: 0 - y: 0 - temp: {x: 0, y: 0, z: 0} - tombstone: tombstone8 - goal: - speed: 3 - pos: - m_ClipName: - player: {fileID: 0} --- !u!1 &816804117 GameObject: m_ObjectHideFlags: 0 @@ -188231,7 +188176,6 @@ GameObject: - component: {fileID: 1300921221} - component: {fileID: 1300921223} - component: {fileID: 1300921222} - - component: {fileID: 1300921224} m_Layer: 0 m_Name: Tombstone7 m_TagString: Untagged @@ -188335,28 +188279,6 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!114 &1300921224 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1300921220} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8d0c116465fe18f49addcc4e95a35f0c, type: 3} - m_Name: - m_EditorClassIdentifier: - position: - x: 0 - y: 0 - temp: {x: 0, y: 0, z: 0} - tombstone: tombstone4 - goal: - speed: 3 - pos: - m_ClipName: - player: {fileID: 0} --- !u!1 &1301056682 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/REFACTORING/Story/Cementary.meta b/Assets/Scripts/REFACTORING/Story/Cementary.meta new file mode 100644 index 00000000..e43fcccf --- /dev/null +++ b/Assets/Scripts/REFACTORING/Story/Cementary.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af373c4a2b82452468b4399aca61e8c5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs b/Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs new file mode 100644 index 00000000..50bf7871 --- /dev/null +++ b/Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs @@ -0,0 +1,45 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TombstoneDoorBlock : MonoBehaviour +{ + public GameObject bars; + + // Start is called before the first frame update + void Start() + { + bars = GameObject.Find("CatacombsDoor"); + } + + // Update is called once per frame + void Update() + { + string tomb1 = PlayerPrefs.GetString("tombstone2"); + string tomb3 = PlayerPrefs.GetString("tombstone3"); + string tomb5 = PlayerPrefs.GetString("tombstone6"); + string tomb6 = PlayerPrefs.GetString("tombstone1"); + string tomb8 = PlayerPrefs.GetString("tombstone9"); + + if (tomb1 == "left" && tomb3 == "left" && tomb5 == "right" && tomb6 == "bottom" && tomb8 == "right") + { + if (gameObject.GetComponent()) + gameObject.GetComponent().isEnabled = true; + + if (gameObject.GetComponent()) + gameObject.GetComponent().isEnabled = true; + + bars.SetActive(false); + } + else + { + if (gameObject.GetComponent()) + gameObject.GetComponent().isEnabled = false; + + if (gameObject.GetComponent()) + gameObject.GetComponent().isEnabled = false; + + bars.SetActive(true); + } + } +} diff --git a/Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs.meta b/Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs.meta new file mode 100644 index 00000000..48d9c2ec --- /dev/null +++ b/Assets/Scripts/REFACTORING/Story/Cementary/TombstoneDoorBlock.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 261dfaba248bb5644becedc6c832e3ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: