Explorar el Código

fixes to deck import - to allow more than 4 copies

Michael8818 hace 4 meses
padre
commit
8a8d7f88a2

+ 4 - 1
Assets/Editor/CheckDeckCodeParse.cs

@@ -58,10 +58,13 @@ public class CheckDeckCodeParse : MonoBehaviour
                     if(char.IsDigit(line[0]))
                     {
                         int count = 0;
+                        int spaceIndex = line.IndexOf(" ");
 
-                        if (int.TryParse(line[0].ToString(), out value))
+                        if (int.TryParse(line.Substring(0,spaceIndex).Trim(), out value))
                             count = value;
 
+                        Debug.Log($"Card Count: {count}");
+
                         for (int i = 0; i < 4; i++)
                         {
                             Debug.Log($"Found Card Count: {line}");

+ 2 - 1
Assets/Scripts/Script/DeckCodeUtility.cs

@@ -121,8 +121,9 @@ public class DeckCodeUtility
                     if (char.IsDigit(line[0]))
                     {
                         int count = 0;
+                        int spaceIndex = line.IndexOf(" ");
 
-                        if (int.TryParse(line[0].ToString(), out value))
+                        if (int.TryParse(line.Substring(0, spaceIndex).Trim(), out value))
                             count = value + plusCount;
 
                         for (int i = 0; i < 4; i++)