Procházet zdrojové kódy

Adjusted Timer and Lobby Menu

Timer now displays at start of lobby
No more loading Screen
Players can now exit matchmaking at any time
cchmc-burkewm před 2 roky
rodič
revize
1817cccd0d

+ 2 - 13
.idea/.idea.DCGO/.idea/workspace.xml

@@ -5,21 +5,10 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="1f770e58-b781-4cb0-ad93-4c50994f611d" name="Changes" comment="">
-      <change beforePath="$PROJECT_DIR$/.idea/.idea.DCGO/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.DCGO/.idea/encodings.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/.idea.DCGO/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.DCGO/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assets/Scenes/Opening.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Opening.unity" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/ContinuousController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/ContinuousController.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/DigiXrosEffectObject.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/DigiXrosEffectObject.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/EvolutionEffectObject.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/EvolutionEffectObject.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/GManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/GManager.cs" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Assets/Scripts/LobbyManager_RandomMatch.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/LobbyManager_RandomMatch.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/PhotonWaitController.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/PhotonWaitController.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/SelectDigiXrosClass.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/SelectDigiXrosClass.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Assets/Scripts/StreamingAssetsUtility.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/StreamingAssetsUtility.cs" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Packages/manifest.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/manifest.json" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Packages/packages-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/Packages/packages-lock.json" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/ProjectSettings/EditorBuildSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/EditorBuildSettings.asset" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/ProjectSettings/PackageManagerSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/PackageManagerSettings.asset" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ProjectSettings/ProjectSettings.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/ProjectSettings.asset" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -115,7 +104,7 @@
       <workItem from="1704380154591" duration="3621000" />
       <workItem from="1705445110111" duration="617000" />
       <workItem from="1707092728240" duration="644000" />
-      <workItem from="1715820047500" duration="16268000" />
+      <workItem from="1715820047500" duration="22060000" />
     </task>
     <servers />
   </component>

+ 35 - 7
Assets/Scripts/LobbyManager_RandomMatch.cs

@@ -32,6 +32,7 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
     string RandomRoomName;
 
     bool endLoadingText = false;
+    private bool isCoroutineRunning = false;
 
     //String that must be included in the random match room
     string RandomKey
@@ -115,9 +116,10 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
         startJoin = false;
         DoneCompleteMatching = false;
         ContinuousController.instance.LoadingTextCoroutine = null;
-        ReturnButton.SetActive(false);
+        ReturnButton.SetActive(true);
         MessageText.text = "";
-        TimeText.gameObject.SetActive(false);
+        TimeText.gameObject.SetActive(true);
+        StartCoroutine(TimeCountUp());
         timer = 0;
         count = true;
 
@@ -147,6 +149,7 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
 
         while (!DoneCompleteMatching)
         {
+            time += (int)Time.deltaTime;
             string min = (time / 60).ToString();
             string sec = (time % 60).ToString();
 
@@ -173,7 +176,7 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
     #region Connect to Photon and Lobby
     IEnumerator ConnectCoroutine()
     {
-        yield return StartCoroutine(loadingObject.StartLoading("Now Loading"));
+        //yield return StartCoroutine(loadingObject.StartLoading("Now Loading"));
 
         if (ContinuousController.instance.BattleDeckData != null)
         {
@@ -371,7 +374,7 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
     {
         if (ReturnButton != null)
         {
-            ReturnButton.SetActive(false);
+            ReturnButton.SetActive(true);
         }
 
         //If there is no room, make room.
@@ -391,10 +394,15 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
     #endregion
 
 
-    IEnumerator SetWaitingText(string defultString)
+    private IEnumerator SetWaitingText(string defaultString)
     {
-        float waitTime = 0.18f;
+        if (isCoroutineRunning)
+        {
+            yield break; // Exit if already running
+        }
 
+        isCoroutineRunning = true;
+        float waitTime = 0.18f;
         int count = 0;
 
         while (!endLoadingText)
@@ -406,7 +414,7 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
                 count = 0;
             }
 
-            MessageText.text = defultString;
+            MessageText.text = defaultString;
 
             for (int i = 0; i < count; i++)
             {
@@ -415,6 +423,22 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
 
             yield return new WaitForSeconds(waitTime);
         }
+
+        isCoroutineRunning = false;
+    }
+
+    public void StartLoadingText(string defaultString)
+    {
+        if (!isCoroutineRunning)
+        {
+            endLoadingText = false; // Ensure the flag is reset when starting
+            StartCoroutine(SetWaitingText(defaultString));
+        }
+    }
+
+    public void StopLoadingText()
+    {
+        endLoadingText = true;
     }
 
     bool count = true;
@@ -449,6 +473,10 @@ public class LobbyManager_RandomMatch : MonoBehaviourPunCallbacks
                 }
             }
         }
+        else
+        {
+            ReturnButtonButton.enabled = true;
+        }
 
         if (DoneCompleteMatching)
         {

+ 2 - 2
ProjectSettings/ProjectSettings.asset

@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:002bc38b5842a32fc929f6797bc14b7d2fccfc133bd26210c0442c0b82e4e3e7
-size 23891
+oid sha256:9064d7a563dfaa1b8b277020a0756d903a103cdc486572ae5aca1a57e5898a93
+size 23800