From 8daf2f25ec0e6d2273a9144a41997a7bf9cce103 Mon Sep 17 00:00:00 2001 From: Zinziel Date: Tue, 10 Feb 2026 11:58:20 +0100 Subject: [PATCH] =?UTF-8?q?T=C3=BCre=20=C3=B6ffnen=20und=20schlie=C3=9Fen?= =?UTF-8?q?=20sich=20per=20Button=20und=20das=20Licht=20kann=20man=20ebenf?= =?UTF-8?q?alls=20per=20Button=20an-aus=20schalten.=20Sound=20w=C3=BCrde?= =?UTF-8?q?=20daf=C3=BCr=20fehlen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../World Prefabs/Spot Light (1).prefab | 129 ++++++++ .../World Prefabs/Spot Light (1).prefab.meta | 7 + .../Prefabs/World Prefabs/Spot Light.prefab | 129 ++++++++ .../World Prefabs/Spot Light.prefab.meta | 7 + .../Prefabs/World Prefabs/light-switch.prefab | 113 +++++++ .../World Prefabs/light-switch.prefab.meta | 7 + Assets/Prefabs/World Prefabs/map.prefab | 130 +++++++- Assets/Scenes/Lilia.unity | 282 +++++++++++++++++- Assets/Scripts/Door/Door.cs | 59 ++++ Assets/Scripts/Door/Door.cs.meta | 2 + Assets/Scripts/Door/DoorController.cs | 10 + Assets/Scripts/Door/DoorController.cs.meta | 2 + Assets/Scripts/Door/LightController.cs | 10 + Assets/Scripts/Door/LightController.cs.meta | 2 + 14 files changed, 885 insertions(+), 4 deletions(-) create mode 100644 Assets/Prefabs/World Prefabs/Spot Light (1).prefab create mode 100644 Assets/Prefabs/World Prefabs/Spot Light (1).prefab.meta create mode 100644 Assets/Prefabs/World Prefabs/Spot Light.prefab create mode 100644 Assets/Prefabs/World Prefabs/Spot Light.prefab.meta create mode 100644 Assets/Prefabs/World Prefabs/light-switch.prefab create mode 100644 Assets/Prefabs/World Prefabs/light-switch.prefab.meta create mode 100644 Assets/Scripts/Door/Door.cs create mode 100644 Assets/Scripts/Door/Door.cs.meta create mode 100644 Assets/Scripts/Door/DoorController.cs create mode 100644 Assets/Scripts/Door/DoorController.cs.meta create mode 100644 Assets/Scripts/Door/LightController.cs create mode 100644 Assets/Scripts/Door/LightController.cs.meta diff --git a/Assets/Prefabs/World Prefabs/Spot Light (1).prefab b/Assets/Prefabs/World Prefabs/Spot Light (1).prefab new file mode 100644 index 0000000..129a600 --- /dev/null +++ b/Assets/Prefabs/World Prefabs/Spot Light (1).prefab @@ -0,0 +1,129 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5414331637232478343 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1975142363331571557} + - component: {fileID: 1499569907104557676} + - component: {fileID: 9152369358141319410} + m_Layer: 0 + m_Name: Spot Light (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1975142363331571557 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5414331637232478343} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 8.2, y: 9.04, z: -8.88} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!108 &1499569907104557676 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5414331637232478343} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 0 + m_Color: {r: 1, g: 0.53171587, b: 0, a: 1} + m_Intensity: 620 + m_Range: 10 + m_SpotAngle: 42.344826 + m_InnerSpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!114 &9152369358141319410 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5414331637232478343} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalLightData + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_CustomShadowLayers: 0 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 diff --git a/Assets/Prefabs/World Prefabs/Spot Light (1).prefab.meta b/Assets/Prefabs/World Prefabs/Spot Light (1).prefab.meta new file mode 100644 index 0000000..c3f5c7d --- /dev/null +++ b/Assets/Prefabs/World Prefabs/Spot Light (1).prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 47c353343d6ccaf40b61ff3f5f8664a2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/World Prefabs/Spot Light.prefab b/Assets/Prefabs/World Prefabs/Spot Light.prefab new file mode 100644 index 0000000..662d81f --- /dev/null +++ b/Assets/Prefabs/World Prefabs/Spot Light.prefab @@ -0,0 +1,129 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1353317353441784100 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8814081592458271809} + - component: {fileID: 5635624417718945727} + - component: {fileID: 7261835535147653884} + m_Layer: 0 + m_Name: Spot Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8814081592458271809 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353317353441784100} + serializedVersion: 2 + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -8.2, y: 9.04, z: -8.88} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!108 &5635624417718945727 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353317353441784100} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 0 + m_Color: {r: 1, g: 0.53171587, b: 0, a: 1} + m_Intensity: 620 + m_Range: 10 + m_SpotAngle: 42.344826 + m_InnerSpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!114 &7261835535147653884 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1353317353441784100} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalLightData + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_CustomShadowLayers: 0 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 + m_RenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_ShadowRenderingLayersMask: + serializedVersion: 0 + m_Bits: 1 + m_Version: 4 + m_LightLayerMask: 1 + m_ShadowLayerMask: 1 + m_RenderingLayers: 1 + m_ShadowRenderingLayers: 1 diff --git a/Assets/Prefabs/World Prefabs/Spot Light.prefab.meta b/Assets/Prefabs/World Prefabs/Spot Light.prefab.meta new file mode 100644 index 0000000..e3c1e78 --- /dev/null +++ b/Assets/Prefabs/World Prefabs/Spot Light.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: efa37ee8d9339bf47bcfe59cde0536fd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/World Prefabs/light-switch.prefab b/Assets/Prefabs/World Prefabs/light-switch.prefab new file mode 100644 index 0000000..fb91e65 --- /dev/null +++ b/Assets/Prefabs/World Prefabs/light-switch.prefab @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5269965775009715031 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8262797039797108360} + - component: {fileID: 8417231306052618144} + - component: {fileID: 7872986358415159679} + - component: {fileID: 4209178796701576314} + m_Layer: 0 + m_Name: light-switch + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8262797039797108360 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5269965775009715031} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 5.65, y: 2.7, z: 10} + m_LocalScale: {x: 0.1, y: 1, z: 0.7} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &8417231306052618144 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5269965775009715031} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7872986358415159679 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5269965775009715031} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d97e68b8fd56e0048add8edffef07014, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &4209178796701576314 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5269965775009715031} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/Assets/Prefabs/World Prefabs/light-switch.prefab.meta b/Assets/Prefabs/World Prefabs/light-switch.prefab.meta new file mode 100644 index 0000000..40f5646 --- /dev/null +++ b/Assets/Prefabs/World Prefabs/light-switch.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f826c5a264d1c4c4f847b99a6360919a +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/World Prefabs/map.prefab b/Assets/Prefabs/World Prefabs/map.prefab index 3394ec6..5a76583 100644 --- a/Assets/Prefabs/World Prefabs/map.prefab +++ b/Assets/Prefabs/World Prefabs/map.prefab @@ -34,6 +34,8 @@ Transform: - {fileID: 1699822110596011254} - {fileID: 7890998032719925093} - {fileID: 8897631008805881011} + - {fileID: 9204467062915419560} + - {fileID: 8798900028808399259} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} --- !u!1001 &278338030704518477 @@ -137,6 +139,68 @@ MonoBehaviour: doorSwitchers: - {fileID: 6200193576773165754} - {fileID: 4680167521826564460} +--- !u!1001 &626179379873838867 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 6429157482948691941} + m_Modifications: + - target: {fileID: 5269965775009715031, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_Name + value: light-switch + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalPosition.x + value: -5.74816 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalPosition.y + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalPosition.z + value: 12.67646 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.y + value: -1 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} +--- !u!4 &8798900028808399259 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + m_PrefabInstance: {fileID: 626179379873838867} + m_PrefabAsset: {fileID: 0} --- !u!1001 &707599933345200699 PrefabInstance: m_ObjectHideFlags: 0 @@ -155,7 +219,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8262797039797108360, guid: e735050751d7930499bae3c522d72f7b, type: 3} propertyPath: m_LocalPosition.y - value: 4.73199 + value: 4.7 objectReference: {fileID: 0} - target: {fileID: 8262797039797108360, guid: e735050751d7930499bae3c522d72f7b, type: 3} propertyPath: m_LocalPosition.z @@ -204,6 +268,68 @@ Transform: m_CorrespondingSourceObject: {fileID: 8262797039797108360, guid: e735050751d7930499bae3c522d72f7b, type: 3} m_PrefabInstance: {fileID: 707599933345200699} m_PrefabAsset: {fileID: 0} +--- !u!1001 &943376748632486688 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 6429157482948691941} + m_Modifications: + - target: {fileID: 5269965775009715031, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_Name + value: light-switch + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalPosition.x + value: 5.55184 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalPosition.y + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalPosition.z + value: 12.67646 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} +--- !u!4 &9204467062915419560 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8262797039797108360, guid: f826c5a264d1c4c4f847b99a6360919a, type: 3} + m_PrefabInstance: {fileID: 943376748632486688} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1587808424810749849 PrefabInstance: m_ObjectHideFlags: 0 @@ -293,7 +419,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8262797039797108360, guid: e735050751d7930499bae3c522d72f7b, type: 3} propertyPath: m_LocalPosition.y - value: 4.73199 + value: 4.7 objectReference: {fileID: 0} - target: {fileID: 8262797039797108360, guid: e735050751d7930499bae3c522d72f7b, type: 3} propertyPath: m_LocalPosition.z diff --git a/Assets/Scenes/Lilia.unity b/Assets/Scenes/Lilia.unity index c0ba123..e8a305c 100644 --- a/Assets/Scenes/Lilia.unity +++ b/Assets/Scenes/Lilia.unity @@ -119,6 +119,116 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &216487815 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5414331637232478343, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + m_PrefabInstance: {fileID: 1887435979575544895} + m_PrefabAsset: {fileID: 0} +--- !u!1 &252776001 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6200193576773165754, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_PrefabInstance: {fileID: 4399004580016263850} + m_PrefabAsset: {fileID: 0} +--- !u!114 &252776006 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252776001} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b48d47b843b1eb242981ed20cce0db89, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + door: {fileID: 1054427158} +--- !u!1 &360402773 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4724855620902478916, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_PrefabInstance: {fileID: 4399004580016263850} + m_PrefabAsset: {fileID: 0} +--- !u!114 &360402778 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 360402773} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0eef5257bc8558642b991b9857cf053f, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::LightSystem + door: {fileID: 473445116} +--- !u!1 &399343426 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1353317353441784100, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + m_PrefabInstance: {fileID: 8457471132400696226} + m_PrefabAsset: {fileID: 0} +--- !u!1 &473445111 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5060194175627891494, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_PrefabInstance: {fileID: 4399004580016263850} + m_PrefabAsset: {fileID: 0} +--- !u!114 &473445116 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 473445111} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a009b121b39a02d4a8dddf11cbda97cc, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + light: {fileID: 216487815} + openPos: {x: 6, y: 10.44, z: -9.67646} + closePos: {x: 6, y: 4.73199, z: -9.67646} + doorSpeed: 5 + isOpen: 0 + isOn: 1 +--- !u!1 &1041857588 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4680167521826564460, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_PrefabInstance: {fileID: 4399004580016263850} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1041857593 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1041857588} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b48d47b843b1eb242981ed20cce0db89, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + door: {fileID: 473445116} +--- !u!1 &1054427153 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4173010635044312775, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_PrefabInstance: {fileID: 4399004580016263850} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1054427158 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1054427153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a009b121b39a02d4a8dddf11cbda97cc, type: 3} + m_Name: + m_EditorClassIdentifier: '::' + light: {fileID: 399343426} + openPos: {x: -5.9, y: 10.44, z: -9.67646} + closePos: {x: -5.9, y: 4.73199, z: -9.67646} + doorSpeed: 5 + isOpen: 0 + isOn: 1 --- !u!1 &1086639983 GameObject: m_ObjectHideFlags: 0 @@ -148,7 +258,7 @@ Light: serializedVersion: 11 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 + m_Intensity: 0 m_Range: 10 m_SpotAngle: 30 m_InnerSpotAngle: 21.80208 @@ -399,6 +509,81 @@ MonoBehaviour: m_VarianceClampScale: 0.9 m_ContrastAdaptiveSharpening: 0 m_Version: 2 +--- !u!1 &1978991700 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4914871766963298423, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_PrefabInstance: {fileID: 4399004580016263850} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1978991705 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1978991700} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0eef5257bc8558642b991b9857cf053f, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::LightSystem + door: {fileID: 1054427158} +--- !u!1001 &1887435979575544895 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalPosition.x + value: 8.2 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalPosition.y + value: 9.04 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalPosition.z + value: -8.88 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1975142363331571557, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5414331637232478343, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} + propertyPath: m_Name + value: Spot Light (1) + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 47c353343d6ccaf40b61ff3f5f8664a2, type: 3} --- !u!1001 &4399004580016263850 PrefabInstance: m_ObjectHideFlags: 0 @@ -411,6 +596,14 @@ PrefabInstance: propertyPath: m_Name value: map objectReference: {fileID: 0} + - target: {fileID: 1699822110596011254, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + propertyPath: m_LocalPosition.x + value: -6 + objectReference: {fileID: 0} + - target: {fileID: 4724855620902478916, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + propertyPath: m_Name + value: light-switch (1) + objectReference: {fileID: 0} - target: {fileID: 6429157482948691941, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} propertyPath: m_LocalPosition.x value: 0 @@ -451,11 +644,94 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 7513714944829640983, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + propertyPath: m_LocalPosition.x + value: 5.9 + objectReference: {fileID: 0} + - target: {fileID: 7513714944829640983, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + propertyPath: m_LocalPosition.y + value: 10.44 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4173010635044312775, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + insertIndex: -1 + addedObject: {fileID: 1054427158} + - targetCorrespondingSourceObject: {fileID: 5060194175627891494, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + insertIndex: -1 + addedObject: {fileID: 473445116} + - targetCorrespondingSourceObject: {fileID: 6200193576773165754, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + insertIndex: -1 + addedObject: {fileID: 252776006} + - targetCorrespondingSourceObject: {fileID: 4680167521826564460, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + insertIndex: -1 + addedObject: {fileID: 1041857593} + - targetCorrespondingSourceObject: {fileID: 4914871766963298423, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + insertIndex: -1 + addedObject: {fileID: 1978991705} + - targetCorrespondingSourceObject: {fileID: 4724855620902478916, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + insertIndex: -1 + addedObject: {fileID: 360402778} + m_SourcePrefab: {fileID: 100100000, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} +--- !u!1001 &8457471132400696226 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1353317353441784100, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_Name + value: Spot Light + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalPosition.x + value: -8.2 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalPosition.y + value: 9.04 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalPosition.z + value: -8.88 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8814081592458271809, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4fd5d28d3a55159479defc3a2e0ce818, type: 3} + m_SourcePrefab: {fileID: 100100000, guid: efa37ee8d9339bf47bcfe59cde0536fd, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -463,3 +739,5 @@ SceneRoots: - {fileID: 1174591347} - {fileID: 1086639985} - {fileID: 4399004580016263850} + - {fileID: 8457471132400696226} + - {fileID: 1887435979575544895} diff --git a/Assets/Scripts/Door/Door.cs b/Assets/Scripts/Door/Door.cs new file mode 100644 index 0000000..59069f0 --- /dev/null +++ b/Assets/Scripts/Door/Door.cs @@ -0,0 +1,59 @@ +using UnityEngine; + +public class Door : MonoBehaviour +{ + [SerializeField] private GameObject light; + + [SerializeField] private Vector3 openPos; + [SerializeField] private Vector3 closePos; + + [SerializeField] private float doorSpeed; + + public bool isOpen; + public bool isOn; + + // Start is called once before the first execution of Update after the MonoBehaviour is created + void Start() + { + transform.position = openPos; + isOpen = true; + + ChangeLights(); + } + + // Update is called once per frame + void Update() + { + if (isOpen) { + if (transform.position != openPos) { + // Damit sich die Tür smooth öffnen lässt. + if (Vector3.Distance(transform.position, openPos) <= 0.5f) { + transform.position = openPos; + } + else { + transform.position = Vector3.Lerp(transform.position, openPos, doorSpeed * Time.deltaTime); + } + } + } else { + if (transform.position != closePos) { + // Damit sich die Tür smooth öffnen lässt. + if (Vector3.Distance(transform.position, closePos) <= 0.5f) { + transform.position = closePos; + } else { + transform.position = Vector3.Lerp(transform.position, closePos, doorSpeed * Time.deltaTime); + } + } + } + } + + public void ChangeLights() { + isOn = !isOn; + + if (isOn) { + light.SetActive(true); + } + else { + light.SetActive(false); + } + } +} diff --git a/Assets/Scripts/Door/Door.cs.meta b/Assets/Scripts/Door/Door.cs.meta new file mode 100644 index 0000000..cb67f3a --- /dev/null +++ b/Assets/Scripts/Door/Door.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a009b121b39a02d4a8dddf11cbda97cc \ No newline at end of file diff --git a/Assets/Scripts/Door/DoorController.cs b/Assets/Scripts/Door/DoorController.cs new file mode 100644 index 0000000..f334d35 --- /dev/null +++ b/Assets/Scripts/Door/DoorController.cs @@ -0,0 +1,10 @@ +using UnityEngine; + +public class DoorController : MonoBehaviour +{ + [SerializeField] private Door door; + + private void OnMouseDown() { + door.isOpen = !door.isOpen; + } +} diff --git a/Assets/Scripts/Door/DoorController.cs.meta b/Assets/Scripts/Door/DoorController.cs.meta new file mode 100644 index 0000000..da6a8b4 --- /dev/null +++ b/Assets/Scripts/Door/DoorController.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b48d47b843b1eb242981ed20cce0db89 \ No newline at end of file diff --git a/Assets/Scripts/Door/LightController.cs b/Assets/Scripts/Door/LightController.cs new file mode 100644 index 0000000..4917bc5 --- /dev/null +++ b/Assets/Scripts/Door/LightController.cs @@ -0,0 +1,10 @@ +using UnityEngine; + +public class LightSystem : MonoBehaviour +{ + [SerializeField] private Door door; + + private void OnMouseDown() { + door.ChangeLights(); + } +} diff --git a/Assets/Scripts/Door/LightController.cs.meta b/Assets/Scripts/Door/LightController.cs.meta new file mode 100644 index 0000000..bf64aba --- /dev/null +++ b/Assets/Scripts/Door/LightController.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0eef5257bc8558642b991b9857cf053f \ No newline at end of file