diff --git a/Assets/CharController.cs b/Assets/AssetsFORELLE/Script/CharController.cs similarity index 100% rename from Assets/CharController.cs rename to Assets/AssetsFORELLE/Script/CharController.cs diff --git a/Assets/CharController.cs.meta b/Assets/AssetsFORELLE/Script/CharController.cs.meta similarity index 100% rename from Assets/CharController.cs.meta rename to Assets/AssetsFORELLE/Script/CharController.cs.meta diff --git a/Assets/AssetsFORELLE/Script/DimShift.cs b/Assets/AssetsFORELLE/Script/DimShift.cs new file mode 100644 index 0000000..3349d19 --- /dev/null +++ b/Assets/AssetsFORELLE/Script/DimShift.cs @@ -0,0 +1,47 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +// Kann sein das das nur für statische Objekte funktioniert +public class DimShift : MonoBehaviour +{ + // 0 = inactive in Dimension 1 + // 1 = active in Dimension 1 + public bool inFirstDim; + BoxCollider2D col; + SpriteRenderer rend; + void Start() + { + col = GetComponent(); + rend = GetComponent(); + + if (inFirstDim) + { + col.enabled = true; + rend.enabled = true; + + } else + { + col.enabled = false; + rend.enabled = false; + } + } + + void Update() + { + if (Input.GetKeyDown(KeyCode.LeftShift)&&inFirstDim) + { + col.enabled = false; + rend.enabled = false; + inFirstDim = !inFirstDim; + } else + { + if (Input.GetKeyDown(KeyCode.LeftShift)&&!inFirstDim) + { + col.enabled = true; + rend.enabled = true; + inFirstDim = !inFirstDim; + } + } + } +} diff --git a/Assets/AssetsFORELLE/Script/DimShift.cs.meta b/Assets/AssetsFORELLE/Script/DimShift.cs.meta new file mode 100644 index 0000000..913a6c9 --- /dev/null +++ b/Assets/AssetsFORELLE/Script/DimShift.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bef524aa2ad305d4faf6b90a610e5be4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/BoxMovable.unity b/Assets/Scenes/BoxMovable.unity index f308633..ac1e9cb 100644 --- a/Assets/Scenes/BoxMovable.unity +++ b/Assets/Scenes/BoxMovable.unity @@ -1165,6 +1165,7 @@ GameObject: - component: {fileID: 1678984579} - component: {fileID: 1678984578} - component: {fileID: 1678984577} + - component: {fileID: 1678984580} m_Layer: 0 m_Name: "Schr\xE4geRunter" m_TagString: Untagged @@ -1265,6 +1266,19 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: -21.629} +--- !u!114 &1678984580 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1678984576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3} + m_Name: + m_EditorClassIdentifier: + inFirstDim: 0 --- !u!1 &2028016239 GameObject: m_ObjectHideFlags: 0 @@ -1276,6 +1290,7 @@ GameObject: - component: {fileID: 2028016242} - component: {fileID: 2028016241} - component: {fileID: 2028016240} + - component: {fileID: 2028016243} m_Layer: 0 m_Name: "Schr\xE4geHoch" m_TagString: Untagged @@ -1376,3 +1391,16 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 26.312} +--- !u!114 &2028016243 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028016239} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3} + m_Name: + m_EditorClassIdentifier: + inFirstDim: 0 diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 1737e80..c574b4c 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -632,6 +632,7 @@ GameObject: - component: {fileID: 921148901} - component: {fileID: 921148900} - component: {fileID: 921148902} + - component: {fileID: 921148903} m_Layer: 0 m_Name: Platform m_TagString: Untagged @@ -732,6 +733,19 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 1, y: 1} m_EdgeRadius: 0 +--- !u!114 &921148903 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 921148899} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3} + m_Name: + m_EditorClassIdentifier: + inFirstDim: 1 --- !u!1 &2021624529 GameObject: m_ObjectHideFlags: 0 @@ -743,6 +757,7 @@ GameObject: - component: {fileID: 2021624531} - component: {fileID: 2021624530} - component: {fileID: 2021624532} + - component: {fileID: 2021624533} m_Layer: 0 m_Name: Wall m_TagString: Untagged @@ -843,3 +858,16 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 1, y: 1} m_EdgeRadius: 0 +--- !u!114 &2021624533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2021624529} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3} + m_Name: + m_EditorClassIdentifier: + inFirstDim: 0