From 103a8c863e84b39063ea909af5533b27320bb50e Mon Sep 17 00:00:00 2001 From: Stefan Richter <o-s-r1993@web.de> Date: Mon, 13 Mar 2023 05:39:18 +0100 Subject: [PATCH] Added Redudant Reloading System --- .../UI/NetwMenue/ASMenue_MnCtrl.prefab | 88 ++++++++--- Assets/Scenes/Menues/LaunchMenue.unity | 5 + .../Scripts/Loading/StreamingAssetLoader.cs | 149 ++++++++++++------ .../Scripts/UI/NetwMenue/StartMenue_mobile.cs | 64 ++++++-- .../StreamingAssets/README_StreamingAssets.md | 4 + .../Stages.meta | 0 .../Stages/TechDemo A.JSON | 0 .../Stages/TechDemo A.JSON.meta | 0 .../Stages/TechDemo B.JSON | 0 .../Stages/TechDemo B.JSON.meta | 0 10 files changed, 228 insertions(+), 82 deletions(-) rename Assets/StreamingAssets/{StreamToDataPath => StreamToDataPath_withHandler}/Stages.meta (100%) rename Assets/StreamingAssets/{StreamToDataPath => StreamToDataPath_withHandler}/Stages/TechDemo A.JSON (100%) rename Assets/StreamingAssets/{StreamToDataPath => StreamToDataPath_withHandler}/Stages/TechDemo A.JSON.meta (100%) rename Assets/StreamingAssets/{StreamToDataPath => StreamToDataPath_withHandler}/Stages/TechDemo B.JSON (100%) rename Assets/StreamingAssets/{StreamToDataPath => StreamToDataPath_withHandler}/Stages/TechDemo B.JSON.meta (100%) diff --git a/Assets/Resources/Prefabs/UI/NetwMenue/ASMenue_MnCtrl.prefab b/Assets/Resources/Prefabs/UI/NetwMenue/ASMenue_MnCtrl.prefab index 6fdb947b..89475aa2 100644 --- a/Assets/Resources/Prefabs/UI/NetwMenue/ASMenue_MnCtrl.prefab +++ b/Assets/Resources/Prefabs/UI/NetwMenue/ASMenue_MnCtrl.prefab @@ -29,6 +29,7 @@ RectTransform: 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: - {fileID: 8364745804310811655} - {fileID: 7606309274667423286} @@ -134,6 +135,7 @@ RectTransform: 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: - {fileID: 3340609296292226240} m_Father: {fileID: 5366996316036003392} @@ -296,6 +298,7 @@ RectTransform: 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: - {fileID: 6414721950609079101} - {fileID: 1662363385475346736} @@ -412,6 +415,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -20} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5380988606775679791} m_Father: {fileID: 8794831640224097889} @@ -558,6 +562,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5541203706653034537} m_RootOrder: 0 @@ -637,6 +642,7 @@ RectTransform: 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: 8842023094143837814} m_RootOrder: 0 @@ -717,6 +723,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 7997862165762406823} m_Father: {fileID: 20385689445018545} @@ -818,6 +825,7 @@ RectTransform: 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: - {fileID: 20385689445018545} m_Father: {fileID: 2702231935465192995} @@ -932,6 +940,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5541203706653034537} m_Father: {fileID: 6414721950609079101} @@ -1034,6 +1043,7 @@ RectTransform: 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: - {fileID: 524790553523465715} m_Father: {fileID: 6414721950609079101} @@ -1195,6 +1205,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 8309989884186066314} m_Father: {fileID: 7313150218793148332} @@ -1294,6 +1305,7 @@ RectTransform: 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: - {fileID: 6123604322396426829} m_Father: {fileID: 20385689445018545} @@ -1370,6 +1382,7 @@ RectTransform: 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: 6414721950609079101} m_RootOrder: 0 @@ -1449,6 +1462,7 @@ RectTransform: 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: 3217975589398024768} m_RootOrder: 0 @@ -1530,6 +1544,7 @@ RectTransform: 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: - {fileID: 7313150218793148332} - {fileID: 6846632430007306933} @@ -1646,6 +1661,7 @@ RectTransform: 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: 8462614897342313128} m_RootOrder: 0 @@ -1737,6 +1753,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -20} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4754993413332535665} m_Father: {fileID: 7606309274667423286} @@ -1885,6 +1902,7 @@ RectTransform: 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: - {fileID: 8822103366894982862} m_Father: {fileID: 7313150218793148332} @@ -2032,6 +2050,7 @@ RectTransform: 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: 3415527872007802782} m_RootOrder: 0 @@ -2121,6 +2140,7 @@ RectTransform: 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: 20385689445018545} m_RootOrder: 4 @@ -2201,6 +2221,7 @@ RectTransform: 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: 7313150218793148332} m_RootOrder: 2 @@ -2280,6 +2301,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 7997862165762406823} m_RootOrder: 0 @@ -2360,6 +2382,7 @@ RectTransform: 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: - {fileID: 3730808201342460051} m_Father: {fileID: 20385689445018545} @@ -2450,6 +2473,7 @@ RectTransform: 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: 4831921658429584611} m_RootOrder: 0 @@ -2531,6 +2555,7 @@ RectTransform: 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: - {fileID: 5366996316744835545} m_Father: {fileID: 5366996316036003392} @@ -2677,6 +2702,7 @@ RectTransform: 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: 5366996315724472123} m_RootOrder: 0 @@ -2758,6 +2784,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5366996316036003392} - {fileID: 5366996315080589335} @@ -2845,14 +2872,6 @@ MonoBehaviour: m_EditorClassIdentifier: myself_GObj: {fileID: 5366996315580957714} child1_GObj: {fileID: 5366996316036003404} - cursorArrow_35: {fileID: 2800000, guid: 5220430f15bc26f44a1d67083ad70598, type: 3} - cursorArrow_50: {fileID: 2800000, guid: e3f1dc3678ee47d4a9e81418681873f6, type: 3} - cursorArrow_60: {fileID: 2800000, guid: b21244787efeae346bf3456d012ef399, type: 3} - cursorArrow_70: {fileID: 2800000, guid: ac543c6f7533f124784c485329d8bf2e, type: 3} - cursorArrow_100: {fileID: 2800000, guid: 4aa214d7cd5f9b64a926d718a8128ca2, type: 3} - cursorArrow_140: {fileID: 2800000, guid: 9c635f241de5cfd4faaf30bad0dfa811, type: 3} - cursorArrow_200: {fileID: 2800000, guid: 98be7b3657f5ba04bb0fc92694813a27, type: 3} - cursorArrow_300: {fileID: 2800000, guid: c1f9f512debcbc7468cdaff818f96d2f, type: 3} GObj_text: {fileID: 0} --- !u!1 &5366996315724472122 GameObject: @@ -2884,6 +2903,7 @@ RectTransform: 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: - {fileID: 5366996315062296220} m_Father: {fileID: 5366996316036003392} @@ -3031,6 +3051,7 @@ RectTransform: 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: - {fileID: 1117501623706235904} - {fileID: 1117501622783544332} @@ -3132,6 +3153,7 @@ RectTransform: 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: - {fileID: 5366996316448052461} - {fileID: 5366996315033671829} @@ -3238,11 +3260,12 @@ RectTransform: 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: 5366996316036003392} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5964376, y: 0} + m_AnchorMin: {x: 0.0964376, y: 0} m_AnchorMax: {x: 0.8964585, y: 0.095370375} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} @@ -3317,6 +3340,7 @@ RectTransform: 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: 5366996315033671829} m_RootOrder: 0 @@ -3396,6 +3420,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -30} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 8309989884186066314} m_RootOrder: 0 @@ -3475,6 +3500,7 @@ RectTransform: 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: 9028122124670701192} m_RootOrder: 0 @@ -3554,6 +3580,7 @@ RectTransform: 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: 20385689445018545} m_RootOrder: 0 @@ -3633,6 +3660,7 @@ RectTransform: 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: 20385689445018545} m_RootOrder: 6 @@ -3712,6 +3740,7 @@ RectTransform: 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: 20385689445018545} m_RootOrder: 5 @@ -3771,6 +3800,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -20} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4410487900111096460} m_Father: {fileID: 2088235654811755430} @@ -3919,6 +3949,7 @@ RectTransform: 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: - {fileID: 478754545032124513} m_Father: {fileID: 7313150218793148332} @@ -4066,6 +4097,7 @@ RectTransform: 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: - {fileID: 8794831640224097889} - {fileID: 3217975589398024768} @@ -4170,6 +4202,7 @@ RectTransform: 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: - {fileID: 4828946832798184929} m_Father: {fileID: 5366996316036003392} @@ -4303,6 +4336,7 @@ RectTransform: 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: - {fileID: 8045247565867104083} - {fileID: 2088235654811755430} @@ -4410,6 +4444,7 @@ RectTransform: 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: - {fileID: 1804196008367291200} m_Father: {fileID: 6414721950609079101} @@ -4556,6 +4591,7 @@ RectTransform: 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: 0.4166666} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5366996316036003392} m_RootOrder: 4 @@ -4631,6 +4667,7 @@ RectTransform: 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: 6914020161757597414} m_RootOrder: 0 @@ -4710,6 +4747,7 @@ RectTransform: 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: 6564702747072136793} m_RootOrder: 0 @@ -5370,18 +5408,18 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 2c2cf35f8e593ea44b2050d129ee23a4, type: 3} ---- !u!1 &1662363385475346737 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 6804933134010575747, guid: 2c2cf35f8e593ea44b2050d129ee23a4, - type: 3} - m_PrefabInstance: {fileID: 5295701069465377458} - m_PrefabAsset: {fileID: 0} --- !u!224 &1662363385475346736 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 6804933134010575746, guid: 2c2cf35f8e593ea44b2050d129ee23a4, type: 3} m_PrefabInstance: {fileID: 5295701069465377458} m_PrefabAsset: {fileID: 0} +--- !u!1 &1662363385475346737 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6804933134010575747, guid: 2c2cf35f8e593ea44b2050d129ee23a4, + type: 3} + m_PrefabInstance: {fileID: 5295701069465377458} + m_PrefabAsset: {fileID: 0} --- !u!1001 &5316996106540909910 PrefabInstance: m_ObjectHideFlags: 0 @@ -5956,18 +5994,18 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c2b1781fb05a3d0478a9fb36c9db98b9, type: 3} ---- !u!224 &5366996315080589335 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 266457294151353665, guid: c2b1781fb05a3d0478a9fb36c9db98b9, - type: 3} - m_PrefabInstance: {fileID: 5316996106540909910} - m_PrefabAsset: {fileID: 0} --- !u!1 &5366996315080589334 stripped GameObject: m_CorrespondingSourceObject: {fileID: 266457294151353664, guid: c2b1781fb05a3d0478a9fb36c9db98b9, type: 3} m_PrefabInstance: {fileID: 5316996106540909910} m_PrefabAsset: {fileID: 0} +--- !u!224 &5366996315080589335 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 266457294151353665, guid: c2b1781fb05a3d0478a9fb36c9db98b9, + type: 3} + m_PrefabInstance: {fileID: 5316996106540909910} + m_PrefabAsset: {fileID: 0} --- !u!1001 &5366996315100264232 PrefabInstance: m_ObjectHideFlags: 0 @@ -6107,15 +6145,15 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c26d76bda684f064780f256b396630c8, type: 3} ---- !u!224 &1117501622783544332 stripped +--- !u!224 &754083156188744073 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 5042148637141777188, guid: c26d76bda684f064780f256b396630c8, + m_CorrespondingSourceObject: {fileID: 4615182551703486113, guid: c26d76bda684f064780f256b396630c8, type: 3} m_PrefabInstance: {fileID: 5366996315100264232} m_PrefabAsset: {fileID: 0} ---- !u!224 &754083156188744073 stripped +--- !u!224 &1117501622783544332 stripped RectTransform: - m_CorrespondingSourceObject: {fileID: 4615182551703486113, guid: c26d76bda684f064780f256b396630c8, + m_CorrespondingSourceObject: {fileID: 5042148637141777188, guid: c26d76bda684f064780f256b396630c8, type: 3} m_PrefabInstance: {fileID: 5366996315100264232} m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scenes/Menues/LaunchMenue.unity b/Assets/Scenes/Menues/LaunchMenue.unity index 0b6e02cb..55cd4632 100644 --- a/Assets/Scenes/Menues/LaunchMenue.unity +++ b/Assets/Scenes/Menues/LaunchMenue.unity @@ -2133,6 +2133,11 @@ PrefabInstance: propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 4262100644587407531, guid: d55296411d4f39e43804eb54bbc798fc, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4297685603710056612, guid: d55296411d4f39e43804eb54bbc798fc, type: 3} propertyPath: m_AnchorMax.y diff --git a/Assets/Scripts/Loading/StreamingAssetLoader.cs b/Assets/Scripts/Loading/StreamingAssetLoader.cs index 1d1d5970..209ba364 100644 --- a/Assets/Scripts/Loading/StreamingAssetLoader.cs +++ b/Assets/Scripts/Loading/StreamingAssetLoader.cs @@ -27,6 +27,61 @@ public static class StreamingAssetLoader public static string ConfigDir = "Config"; public static string ConfigFile_Network = "Network.JSON"; + //For Android, Everything in StreamingAssets must be registered! + public static string StreamToPersistentDataPath_FILE_1 = "scrolls.json"; + public static string Stage_Folder = "Stages"; + public static string Stage_1 = "TechDemo A.JSON"; + public static string Stage_2 = "TechDemo B.JSON"; + + public static void ResetPlayerConfig() + { + string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder, ConfigDir); + string targetFolder = Application.persistentDataPath; + + RereadFileWithUnityWebRequest(sourcePath, ConfigDir, ConfigFile_Network, targetFolder); + NetworkJSON_Load(); + } + + public static bool ReloadManualy_StreamToPers() + { + ResetPlayerConfig(); + string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder); + string targetFolder = Application.persistentDataPath; + RereadFileWithUnityWebRequest(sourcePath, "", StreamToPersistentDataPath_Folder_Cookie, targetFolder); + RereadFileWithUnityWebRequest(sourcePath, "", StreamToPersistentDataPath_FILE_1, targetFolder); + NetworkJSON_Load(); + //Debug.Log("Reloaded_PP"); + return true; + } + public static bool ReloadManualy_StreamToDataPath() + { + string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder); + string targetFolder = Application.dataPath; + RereadFileWithUnityWebRequest(sourcePath, "", StreamToDataPath_Folder_Cookie, targetFolder); + + NetworkJSON_Load(); + //Debug.Log("Reloaded_DP"); + return true; + } + public static bool ReloadManualy_StreamToDataPathWithHandler(string TargetDir_1) + { + string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_withHandler_Folder); + string targetFolder_dpwh = TargetDir_1 ; + //Debug.Log(targetFolder_dpwh); + + string sourcePath2 = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_withHandler_Folder, Stage_Folder); + RereadFileWithUnityWebRequest(sourcePath2, Stage_Folder, Stage_1, targetFolder_dpwh); + RereadFileWithUnityWebRequest(sourcePath2, Stage_Folder, Stage_2, targetFolder_dpwh); + + NetworkJSON_Load(); + //Debug.Log("Reloaded_DPwH"); + return true; + } + //--------------------------------------------------------------------------------------- + + + + //public static ID_toPath toPath = ID_toPath.DataPath; public enum ID_toPath { @@ -156,63 +211,74 @@ public static void deleteADirectoryAndSubDir(string path) } } } - public static void ResetPlayerConfig() - { - string sourcePath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder, ConfigDir); - string targetFolder = Application.persistentDataPath; - RereadFileWithUnityWebRequest(sourcePath, ConfigDir, ConfigFile_Network, targetFolder); - NetworkJSON_Load(); - } public static void RereadFiles_PersistentDataPath() { - Debug.Log("Reread_PersistentDataPath"); + + //Debug.Log("Reread_PersistentDataPath"); //RereadFileUWR(StreamingAssetLoader.file_1_path, StreamingAssetLoader.file_1, ID_toPath.PersistentDataPath); //---- string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToPersistentDataPath_Folder); string targetFolder = Application.persistentDataPath; - ReReadFiles(rootPath, targetFolder); - - - + if(!ReReadFiles(rootPath, targetFolder)){ + ReloadManualy_StreamToPers(); + } } public static void RereadFiles_DataPath() { - Debug.Log("Reread_DataPath"); + //Debug.Log("Reread_DataPath"); string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder); string targetFolder = Application.dataPath; - ReReadFiles(rootPath, targetFolder); + RereadFiles_DataPath_withHandler(); + if (!ReReadFiles(rootPath, targetFolder)) + { + ReloadManualy_StreamToDataPath(); + } + } public static void RereadFiles_DataPath_withHandler() { string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_withHandler_Folder); - string targetFolder = Application.dataPath; + string targetFolder_wh = Application.dataPath; + + //Debug.Log(CommunicationEvents.Opsys); if (CommunicationEvents.Opsys == OperationSystem.Android) { - targetFolder = Application.persistentDataPath; + targetFolder_wh = Application.persistentDataPath; + //Debug.Log(OperationSystem.Android + " " + targetFolder_wh); } - ReReadFiles(rootPath, targetFolder); + if (!ReReadFiles(rootPath, targetFolder_wh)) + { + //Debug.Log( " 2 " + targetFolder_wh); + ReloadManualy_StreamToDataPathWithHandler(targetFolder_wh); + } } - public static void ReReadFiles(string rootPath, string targetFolder)//ID_toPath PathHandler) + public static bool ReReadFiles(string rootPath, string targetFolder)//ID_toPath PathHandler) { - if (!Directory.Exists(rootPath)) { return ; } + if (!Directory.Exists(rootPath)) { Debug.Log("no Dir: " + rootPath); return false ; } //---- + //Debug.Log("Loading Dir"); string dir = ""; DirectoryInfo dirInfo = new DirectoryInfo(@rootPath); FileInfo[] Files = dirInfo.GetFiles("*"); foreach (FileInfo file in Files) { if (file.Name.Contains(".meta")) { continue; }; - RereadFileWithUnityWebRequest(rootPath, dir, file.Name, targetFolder); + if (!RereadFileWithUnityWebRequest(rootPath, dir, file.Name, targetFolder)) + { + return false; + + } } //---- + //Debug.Log("Saving Dir"); string[] dirs = Directory.GetDirectories(rootPath, "*", SearchOption.AllDirectories); foreach (string dir_fullpath in dirs) { @@ -226,9 +292,14 @@ public static void ReReadFiles(string rootPath, string targetFolder)//ID_toPath foreach (FileInfo file in Files) { if (file.Name.Contains(".meta")) { continue; }; - RereadFileWithUnityWebRequest(dir_fullpath, dir, file.Name, targetFolder); + if(!RereadFileWithUnityWebRequest(dir_fullpath, dir, file.Name, targetFolder)){ + return false; + } } } + + //Debug.Log("Dir Reloaded"); + return true; } public static void NetworkJSON_Load() @@ -246,7 +317,7 @@ public static void NetworkJSON_Load_0() public static void NetworkJSON_Load_x(string path) { - var reader = new StreamReader(Path.Combine(path, ConfigDir, ConfigFile_Network)); + var reader = new StreamReader(Path.Combine(path, ConfigDir, ConfigFile_Network)); string json = reader.ReadToEnd(); reader.Close(); @@ -375,11 +446,11 @@ public static void RereadFileUWR(string pathfolders, string fileName, ID_toPath } } - public static void RereadFileWithUnityWebRequest(string sourcePath1, string pathfolders, string fileName, string targetpath) + public static bool RereadFileWithUnityWebRequest(string sourcePath1, string pathfolders, string fileName, string targetpath) { - if (fileName == "") { Debug.Log("no File"); return; } + if (fileName == "") { Debug.Log("no File"); return false; } string destpathf = pathfolders; string destname = fileName; @@ -397,14 +468,15 @@ public static void RereadFileWithUnityWebRequest(string sourcePath1, string path } if (loadingRequest.result == UnityWebRequest.Result.ConnectionError || loadingRequest.result == UnityWebRequest.Result.ProtocolError) { - Debug.Log("ConnectionError"); + Debug.Log("ConnectionError" + sourcePath); + return false; } else { - - + + string destinationPath = Path.Combine(targetpath, destpathf); - + //Debug.Log("ss" + destinationPath + "," + Application.persistentDataPath + "," + Application.dataPath + "," + destpathf + " , " + destname); SafeCreateDirectory(destinationPath); @@ -414,6 +486,7 @@ public static void RereadFileWithUnityWebRequest(string sourcePath1, string path //Debug.Log("ss" + destinationPath); } + return true; } //Path.Combine() but without the Path.IsPathRooted() @@ -446,14 +519,7 @@ public static string CombineTwoPaths(string path1, string path2) /* public static string RereadFileNA(string pathfolders, string fileName, string destpathf, string destname) { - if (fileName == "") - { - return "noName"; - } - - - - + if (fileName == ""){return "noName"; } // copies and unpacks file from apk to persistentDataPath where it can be accessed string destinationPath = Path.Combine(Application.persistentDataPath, destpathf); @@ -461,11 +527,8 @@ public static string RereadFileNA(string pathfolders, string fileName, string de { Directory.CreateDirectory(destinationPath); } - - destinationPath = Path.Combine(destinationPath, destname); - string sourcePath = Path.Combine(Application.streamingAssetsPath, pathfolders); sourcePath = Path.Combine(sourcePath, fileName); @@ -479,9 +542,6 @@ public static string RereadFileNA(string pathfolders, string fileName, string de //UnityEngine.Debug.Log(string.Format("{0}-{1}-{2}-{3}", sourcePath, File.GetLastWriteTimeUtc(sourcePath), File.GetLastWriteTimeUtc(destinationPath))); - - - //copy whatsoever //if DB does not exist in persistent data folder (folder "Documents" on iOS) or source DB is newer then copy it @@ -520,10 +580,9 @@ public static string RereadFileNA(string pathfolders, string fileName, string de StreamReader reader = new StreamReader(destinationPath); var jsonString = reader.ReadToEnd(); - reader.Close(); - + reader.Close(); - return jsonString; + return jsonString; } */ diff --git a/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs b/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs index c5201a09..fe374f5a 100644 --- a/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs +++ b/Assets/Scripts/UI/NetwMenue/StartMenue_mobile.cs @@ -12,8 +12,7 @@ using static UIconfig; using static StreamingAssetLoader; using static CommunicationEvents; - - +using System; public class StartMenue_mobile : MonoBehaviour { @@ -33,7 +32,7 @@ public class StartMenue_mobile : MonoBehaviour private void Awake() { ScreenOptimization(); - + //GObj_text.text = "1: "+ Application.streamingAssetsPath + " " + Application.persistentDataPath + " " + Application.dataPath; toChild1(); if (checkOperationSystemAlreadyDone == false || checkOperationSystemAlreadyDone_check == false) { @@ -41,6 +40,8 @@ private void Awake() checkOperationSystemAlreadyDone = true; } GObj_text.text = CommunicationEvents.Opsys + ""; + //GObj_text.text = "2: " + Application.streamingAssetsPath + " " + Application.persistentDataPath + " " + Application.dataPath; + //Debug.Log(Application.streamingAssetsPath); CheckServerA[1] = 1; CheckServerA[2] = 1; CheckServerA[3] = 1; @@ -54,40 +55,78 @@ void Start() void start2_CheckOS_CheckConfig() { - //Default Settings: - NetworkJSON_Load_0(); + //Try to find existing Config: + int configExists = 0; + //Debug.Log("Load Streaming Asset"); + try { NetworkJSON_Load_0(); configExists=1; } + catch (Exception e) + { + Debug.Log(e); + } + //Debug.Log("Load Streaming Asset finished"); //Debug.Log(checkPersistentDataPath()); - if (checkPersistentDataPath()) + try { NetworkJSON_Load(); + configExists = 2; + } + catch(Exception e) + { + Debug.Log(e); } - //Welches Betriebssystem? - checkOS(); + + if (configExists == 0) + { + Debug.Log(configExists + "No Config found"); + checkOS2(); + try + { + ResetPlayerConfig(); + NetworkJSON_Load(); + configExists = 3; + } + catch (Exception e) + { + Debug.Log(e); + } + } + else + { + //Debug.Log(configExists + "Config found"); + checkOS(); + } //Entpacken - if (!checkPersistentDataPath()) + if (!checkPersistentDataPath() || configExists<1) { //Debug.Log("initialReset_PDP"); ResetPersistentDataPath(); + //Debug.Log("Reset_PDP_finished"); + NetworkJSON_Load(); checkOS(); changeSettingsToOS(); NetworkJSON_Save(); } //Save CheckOS NetworkJSON_Save(); - + + //Debug.Log("StartAdaption"); if (autoSettingsAdaption) { changeSettingsToOS(); NetworkJSON_Save(); } + //Debug.Log("EndAdaption"); NetworkJSON_Load(); - if (!checkDataPath()) + + if (!checkDataPath() || true) { ResetDataPath(); + //Debug.Log("DataPath new finished"); }; + //Debug.Log("DataPath finished"); setMouse(); - + if (UIconfig.MouseKeepingInWindow == true) { Cursor.lockState = CursorLockMode.Confined; @@ -96,6 +135,7 @@ void start2_CheckOS_CheckConfig() { Cursor.lockState = CursorLockMode.None; } + } private void Update() diff --git a/Assets/StreamingAssets/README_StreamingAssets.md b/Assets/StreamingAssets/README_StreamingAssets.md index 3a645bdb..043f859a 100644 --- a/Assets/StreamingAssets/README_StreamingAssets.md +++ b/Assets/StreamingAssets/README_StreamingAssets.md @@ -1,3 +1,7 @@ +## Info: +For OperatingSystem Android: please register all Files in StreamingAssetLoader! + + ## StreamToDataPath: All files and subfolders will be copied to DataPath. Exception: Files with "meta" in the name. diff --git a/Assets/StreamingAssets/StreamToDataPath/Stages.meta b/Assets/StreamingAssets/StreamToDataPath_withHandler/Stages.meta similarity index 100% rename from Assets/StreamingAssets/StreamToDataPath/Stages.meta rename to Assets/StreamingAssets/StreamToDataPath_withHandler/Stages.meta diff --git a/Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo A.JSON b/Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo A.JSON similarity index 100% rename from Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo A.JSON rename to Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo A.JSON diff --git a/Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo A.JSON.meta b/Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo A.JSON.meta similarity index 100% rename from Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo A.JSON.meta rename to Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo A.JSON.meta diff --git a/Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo B.JSON b/Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo B.JSON similarity index 100% rename from Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo B.JSON rename to Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo B.JSON diff --git a/Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo B.JSON.meta b/Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo B.JSON.meta similarity index 100% rename from Assets/StreamingAssets/StreamToDataPath/Stages/TechDemo B.JSON.meta rename to Assets/StreamingAssets/StreamToDataPath_withHandler/Stages/TechDemo B.JSON.meta -- GitLab