diff --git a/Assets/Scenes/TreeWorld_02.unity b/Assets/Scenes/TreeWorld_02.unity index 0cd667b60db804095ead64f9864ec688357fe510..5d4942e74553e3dde2548e8aa7583bb021399932 100644 --- a/Assets/Scenes/TreeWorld_02.unity +++ b/Assets/Scenes/TreeWorld_02.unity @@ -41258,6 +41258,11 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 4004370943283418989, guid: c1d50ceff6c06de40b71063574eba754, + type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: magicButtonTrigger + objectReference: {fileID: 0} - target: {fileID: 8372521933580734050, guid: c1d50ceff6c06de40b71063574eba754, type: 3} propertyPath: m_AnchorMax.x diff --git a/Assets/Scripts/HideUI.cs b/Assets/Scripts/HideUI.cs index a44a66f62628239357a6f70a418b44219939f0a5..1719e1e5d490cd05f402ca8520a9f12e3222cde1 100644 --- a/Assets/Scripts/HideUI.cs +++ b/Assets/Scripts/HideUI.cs @@ -50,6 +50,7 @@ void Update() } /* + //Todo before capturing: Make directories "UFrameIT-Screenshots/Unity_ScreenCapture" in project folder else if (Input.GetKeyDown(ScreenshotKey)) { ScreenCapture.CaptureScreenshot("UFrameIT-Screenshots\\Unity_ScreenCapture\\Capture.png"); } diff --git a/Assets/Scripts/InteractionEngine/Fact.cs b/Assets/Scripts/InteractionEngine/Fact.cs index c724496105fd37d8f2e4c10c6a043fe18af13e6d..d99dc3bcdc4d8a8ce781e3f7eb08da51125f1ea4 100644 --- a/Assets/Scripts/InteractionEngine/Fact.cs +++ b/Assets/Scripts/InteractionEngine/Fact.cs @@ -3,7 +3,6 @@ using UnityEngine; using UnityEngine.Networking; using static JSONManager; -using static FactManager; public class ParsingDictionary { diff --git a/Assets/Scripts/InventoryStuff/ScrollDetails.cs b/Assets/Scripts/InventoryStuff/ScrollDetails.cs index 9cdf4d536ea7f67a47948bb967f94bcb576cda13..27ed12e8e7fdcc8c9c26666b3da45308bf0aac16 100644 --- a/Assets/Scripts/InventoryStuff/ScrollDetails.cs +++ b/Assets/Scripts/InventoryStuff/ScrollDetails.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; using UnityEngine; using TMPro; using UnityEngine.Networking; @@ -30,7 +31,7 @@ void Start() parameterDisplayHint.AddListener(animateScrollParameter); CompletionsHintEvent.AddListener(animateCompletionsHint); - NewAssignmentEvent.AddListener(newAssignment); + NewAssignmentEvent.AddListener(newAssignmentTrigger); } public void setScroll(Scroll s) @@ -61,33 +62,64 @@ public void setScroll(Scroll s) } } - public void magicButton() + public void magicButtonTrigger() { + StartCoroutine(magicButton()); + } + + IEnumerator magicButton() { - string answer = sendView("/scroll/apply"); - - if (answer == null) + bool workDone = false; + + while (!workDone) { - Debug.Log("DAS HAT NICHT GEKLAPPT"); - //TODO: hier ne Art PopUp, wo drin steht, dass das nicht geklappt hat - PushoutFactFailEvent.Invoke(null); - return; + // Let the engine run for a frame for not letting the game freeze + yield return null; + + string answer = sendView("/scroll/apply"); + + if (answer == null) + { + Debug.Log("DAS HAT NICHT GEKLAPPT"); + //TODO: hier ne Art PopUp, wo drin steht, dass das nicht geklappt hat + PushoutFactFailEvent.Invoke(null); + } + else + { + Scroll.ScrollApplicationInfo pushout = JsonConvert.DeserializeObject<Scroll.ScrollApplicationInfo>(answer); + readPushout(pushout.acquiredFacts); + } + + workDone = true; } + } - Scroll.ScrollApplicationInfo pushout = JsonConvert.DeserializeObject<Scroll.ScrollApplicationInfo>(answer); - readPushout(pushout.acquiredFacts); + public void newAssignmentTrigger() { + StartCoroutine(newAssignment()); } - public void newAssignment() + IEnumerator newAssignment() { - string answer = sendView("/scroll/dynamic"); + bool workDone = false; - if (answer == null) + while (!workDone) { - Debug.Log("DAS HAT NICHT GEKLAPPT"); - return; + // Let the engine run for a frame for not letting the game freeze + yield return null; + + string answer = sendView("/scroll/dynamic"); + + if (answer == null) + { + Debug.Log("DAS HAT NICHT GEKLAPPT"); + } + else + { + Scroll.ScrollDynamicInfo scrollDynamicInfo = JsonConvert.DeserializeObject<Scroll.ScrollDynamicInfo>(answer); + processScrollDynamicInfo(scrollDynamicInfo); + } + + workDone = true; } - Scroll.ScrollDynamicInfo scrollDynamicInfo = JsonConvert.DeserializeObject<Scroll.ScrollDynamicInfo>(answer); - processScrollDynamicInfo(scrollDynamicInfo); } private string sendView(string endpoint)