Cleaned Scripts, added comments, added end scene

This commit is contained in:
Thorbjoern
2025-07-03 13:31:47 +02:00
parent 410166ba80
commit 9a54b4ee58
9 changed files with 461 additions and 31 deletions
+205
View File
@@ -0,0 +1,205 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &77762120
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2609244665444592624, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3313144939985428462, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: myRoom
value:
objectReference: {fileID: 11400000, guid: 31664cbb4d885d140b5467c7a8f0cb29,
type: 2}
- target: {fileID: 3313144939985428462, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: sceneId
value: End
objectReference: {fileID: 0}
- target: {fileID: 4241828730387503596, guid: 4bdb51a4282b64348a9467164a0230ee,
type: 3}
propertyPath: m_Name
value: RoomManager
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4bdb51a4282b64348a9467164a0230ee, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 77762120}
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1aa1485b0239d5943aaca87a1154ad67
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+178 -6
View File
@@ -1980,6 +1980,16 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 186710618678607447, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0.0001296997
objectReference: {fileID: 0}
- target: {fileID: 186710618678607447, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.0000076293945
objectReference: {fileID: 0}
- target: {fileID: 1007172833528313422, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_IsActive
@@ -2005,6 +2015,11 @@ PrefabInstance:
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4094252763031089028, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4137696318583964402, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_Size
@@ -2075,6 +2090,21 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6593753845656647679, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_LocalScale.x
value: 0.002
objectReference: {fileID: 0}
- target: {fileID: 6593753845656647679, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_LocalScale.y
value: 0.002
objectReference: {fileID: 0}
- target: {fileID: 6593753845656647679, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_LocalScale.z
value: 0.002
objectReference: {fileID: 0}
- target: {fileID: 7476524807590443855, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
propertyPath: m_Name
@@ -2131,7 +2161,8 @@ PrefabInstance:
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 3167532973326127718, guid: eea4685c3d0950b43b296cae5bc70053, type: 3}
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 7512671986383540632, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
@@ -2139,12 +2170,16 @@ PrefabInstance:
addedObject: {fileID: 1419059281}
- targetCorrespondingSourceObject: {fileID: 186710618678607447, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
insertIndex: 0
insertIndex: -1
addedObject: {fileID: 1864973020}
- targetCorrespondingSourceObject: {fileID: 186710618678607447, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
insertIndex: 1
insertIndex: -1
addedObject: {fileID: 1797910564}
- targetCorrespondingSourceObject: {fileID: 186710618678607447, guid: eea4685c3d0950b43b296cae5bc70053,
type: 3}
insertIndex: -1
addedObject: {fileID: 1566043033}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: eea4685c3d0950b43b296cae5bc70053, type: 3}
--- !u!4 &304632834 stripped
@@ -10048,6 +10083,142 @@ MonoBehaviour:
_freezeRotationX: 0
_freezeRotationY: 0
_freezeRotationZ: 0
--- !u!1 &1566043032
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1566043033}
- component: {fileID: 1566043035}
- component: {fileID: 1566043034}
m_Layer: 5
m_Name: Debug Flush (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1566043033
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566043032}
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: 2045408655}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1566043034
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566043032}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "Dr\xFCcke den rechten Trigger, um den n\xE4chsten Raum zu laden."
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 1024
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: -51.394997}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1566043035
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1566043032}
m_CullTransparentMesh: 1
--- !u!1 &1570418470
GameObject:
m_ObjectHideFlags: 0
@@ -10703,6 +10874,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
output: {fileID: 1797910565}
instruction: {fileID: 0}
recorder: {fileID: 2089505615}
loadingScreen: {fileID: 1815111294}
canvas: {fileID: 304632835}
@@ -11542,7 +11714,7 @@ MonoBehaviour:
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_VerticalAlignment: 1024
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
@@ -12111,8 +12283,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 20
m_fontSizeBase: 20
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
+19
View File
@@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 52a5761204929f34abe1c66ab2876c93, type: 3}
m_Name: End
m_EditorClassIdentifier:
sceneId: End
doors: 0
furniture: 0
portals: 0
enemies: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 31664cbb4d885d140b5467c7a8f0cb29
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -43,14 +43,12 @@ namespace GhostSystem
{
SupabaseManager.OnSuperbaseReady += HandleSupabaseReady;
RoomManager.OnSceneIdReady += HandleSceneIdReady;
//StopRecordingTrigger.OnRecordStop += HandleRecordStop;
}
private void OnDisable()
{
SupabaseManager.OnSuperbaseReady -= HandleSupabaseReady;
RoomManager.OnSceneIdReady -= HandleSceneIdReady;
//StopRecordingTrigger.OnRecordStop -= HandleRecordStop;
}
private void Start()
@@ -83,15 +81,9 @@ namespace GhostSystem
doorCount++;
}
}
//StartRecording();
}
}
/*private void HandleRecordStop()
{
StopRecording();
}*/
private void Update()
{
if (!_isRecording) return;
@@ -105,6 +97,7 @@ namespace GhostSystem
RecordSample();
}
// Würde genutzt werden, um live in die Datenbank hochzuladen.
/*if (_frameBuffer.Count >= BatchSize || _flushTimer >= FlushInterval)
{
_flushTimer = 0f;
@@ -121,7 +114,7 @@ namespace GhostSystem
}
}
private async UniTaskVoid FlushBatchAsync()
private async UniTaskVoid FlushBatchAsync() // Die eigentliche Methode zum Hochladen eines Batches/leeren des Buffers.
{
if (_frameBuffer.Count == 0 || !supabaseReady) return;
@@ -131,13 +124,13 @@ namespace GhostSystem
try
{
var response = await SupabaseManager.instance.supabase.From<FrameModel>().Insert(batch);
var response = await SupabaseManager.instance.supabase.From<FrameModel>().Insert(batch); // Versucht, den Batch an Superbase hochzuladen
if (!response.ResponseMessage.IsSuccessStatusCode)
{
Debug.LogWarning($"Batch insert failed: {response.ResponseMessage.StatusCode}, fallback to offline.");
await FallbackToOfflineAsync(batch);
}
if(response.ResponseMessage.IsSuccessStatusCode && sceneIdReady)
if (response.ResponseMessage.IsSuccessStatusCode && sceneIdReady) // Löst Action aus, wenn der Upload geklappt hat und die neue Szene geladen ist.
{
OnUploadFinished?.Invoke();
Debug.Log("Upload Finished");
@@ -147,13 +140,13 @@ namespace GhostSystem
catch (Exception ex)
{
Debug.LogWarning($"Insert failed, fallback to offline: {ex.Message}");
await FallbackToOfflineAsync(batch);
OnUploadFinished?.Invoke();
await FallbackToOfflineAsync(batch); // Bei nicht erfolgtem Upload wird der Batch lokal gescpeichert.
OnUploadFinished?.Invoke(); // Die Action für das Ende des Ladescreens wird trotzdem ausgelöst.
Debug.Log("Upload Finished");
}
}
private async UniTask FallbackToOfflineAsync(List<FrameModel> batch)
private async UniTask FallbackToOfflineAsync(List<FrameModel> batch) // Schreibt den Buffer in eine Datei, falls Upload nicht möglich
{
try
{
@@ -193,10 +186,9 @@ namespace GhostSystem
doorCount = 0;
}
public void Flush()
public void Flush() // Manueller Flush
{
_flushTimer = 0f;
//FlushBatchAsync();
_ = FlushBatchAsync(); // Fire and forget
}
}
+22 -6
View File
@@ -3,14 +3,18 @@ using UnityEngine;
using UnityEngine.SceneManagement;
using TMPro;
using System.Collections.Generic;
using UnityEngine.UI;
public class FlushAndLoad : MonoBehaviour
{
public TMP_Text output;
public TMP_Text instruction;
public GhostRecorderBatch recorder;
public GameObject loadingScreen;
public GameObject canvas;
private string sceneId;
private void OnEnable()
{
GhostRecorderBatch.OnUploadFinished += HandleUploadFinished;
@@ -34,13 +38,17 @@ public class FlushAndLoad : MonoBehaviour
{
if (OVRInput.GetDown(OVRInput.Button.SecondaryIndexTrigger))
{
output.text = "Flush...";
loadingScreen.SetActive(true);
canvas.SetActive(false);
recorder.Flush();
GetComponent<SceneLoader>().NewRoom();
if (sceneId == "End") Application.Quit();
else
{
output.text = "Flush...";
loadingScreen.SetActive(true);
canvas.SetActive(false);
recorder.Flush();
GetComponent<SceneLoader>().NewRoom();
}
}
}
@@ -48,10 +56,18 @@ public class FlushAndLoad : MonoBehaviour
{
loadingScreen.SetActive(false);
output.text = "";
if (sceneId == "End")
{
output.text = "Durchlauf beendet.";
instruction.text = "Drücke den rechten Trigger, um die Anwendung zu beenden.";
canvas.SetActive(true);
}
}
private void HandleSceneIdReady(string id, List<GameObject> doors)
{
sceneId = id;
if (id == "Room1")
{
loadingScreen.SetActive(false);
+11 -3
View File
@@ -52,7 +52,7 @@ public class SceneLoader : MonoBehaviour
LoadNewRoom();
}
private async UniTaskVoid LoadNewRoom()
private async UniTaskVoid LoadNewRoom() // Aktuelle Methode zum Laden von Szenen
{
int sceneCount = SceneManager.sceneCount;
@@ -65,7 +65,15 @@ public class SceneLoader : MonoBehaviour
await SceneManager.UnloadSceneAsync(myScene);
}
}
await SceneManager.LoadSceneAsync(currentScene + 1, LoadSceneMode.Additive);
Debug.Log("Loaded Room " + currentScene + 1);
if (currentScene == SceneManager.sceneCountInBuildSettings-1)
{
await SceneManager.LoadSceneAsync(baseSceneIndex); // Lädt die Basis-Szene komplett neu, falls vorherige Szene die letzte war.
}
else
{
await SceneManager.LoadSceneAsync(currentScene + 1, LoadSceneMode.Additive); // Lädt die nächste Szene additiv
Debug.Log("Loaded Room " + (currentScene + 1));
}
}
}
@@ -71,6 +71,9 @@ EditorBuildSettings:
- enabled: 1
path: Assets/_Scenes/CQB/Room 12.unity
guid: 183ff68200b7fb8498ca55bf95de872c
- enabled: 1
path: Assets/_Scenes/CQB/End.unity
guid: 1aa1485b0239d5943aaca87a1154ad67
m_configObjects:
Unity.XR.Oculus.Settings: {fileID: 11400000, guid: 734f15aa67f6c994aabd946b919ab4ea,
type: 2}