baxi 41 phút trước cách đây
mục cha
commit
52466bd1cb

+ 3 - 17
Assets/AppRuntimes/Scripts/AppRuntimes.cs

@@ -126,7 +126,6 @@ public static class AppRuntimes
 
     public static void SetInteface(IDialog dialog, ILoading loading)
     {
-        // Dialogs always use the native system UI. Keep this signature for existing callers.
         Loading = loading;
     }
 
@@ -185,7 +184,7 @@ public static class AppRuntimes
 
     public static async UniTask<bool> CheckVersion()
     {
-        if (await CheckEnabled())
+        if(await CheckEnabled())
         {
             InitFB();
             var platform = await Platform();
@@ -210,7 +209,7 @@ public static class AppRuntimes
             {
                 var ts = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                 var url = string.Format("{0}?v={1}", PrivacyUrl, ts);
-                Debug.Log(url);
+                Log(url);
                 using var handler = UnityWebRequest.Get(url);
                 var result = await handler.SendWebRequest();
                 PrivacyContent = result.downloadHandler.text;
@@ -266,7 +265,7 @@ public static class AppRuntimes
                 string requestBody = GetRequestBody(body);
                 var requestFailed = false;
                 var res = await Https.POST<PlatformResponse>(url, requestBody, _ => requestFailed = true);
-                // Failed requests return a default response. Do not decrypt it first.
+                
                 if (!requestFailed)
                     return ClientCrypto.DecryptJson(res.data);
 
@@ -294,7 +293,6 @@ public static class AppRuntimes
         catch (ArgumentException e)
         {
             Debug.LogError(e);
-            // Some devices can report an invariant or neutral culture.
         }
 
         //Debug.LogFormat("region:{0} sysLang:{1}", region, Application.systemLanguage);
@@ -311,7 +309,6 @@ public static class AppRuntimes
     private static UniTask<bool> ShowNetworkError()
     {
 #if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR
-        // Credentials and platform requests can fail together. Share one dialog.
         if (NetworkErrorCompletion != null)
             return NetworkErrorCompletion.Task;
 
@@ -349,9 +346,6 @@ public static class AppRuntimes
         var backgroundColor = Color.black;
         CreateWebViewBackground(webViewGameObject, backgroundColor);
 
-        // Native content insets do not constrain fixed-position HTML elements
-        // and can make their visual and touch positions differ. Keep them off
-        // and constrain the native web view itself to the iOS safe area.
         webView.SetContentInsetAdjustmentBehavior(UniWebViewContentInsetAdjustmentBehavior.Never);
         webView.BackgroundColor = backgroundColor;
         ApplyWebViewSafeAreaFrame(webView);
@@ -364,8 +358,6 @@ public static class AppRuntimes
         webView.OnShouldClose += (view) => false;
         webView.OnPageStarted += (view, loadingUrl) =>
         {
-            // UniWebView is a native view and is always rendered above Unity UI.
-            // Hide it while loading so the Loading prefab can be seen.
             view.Hide();
             SetWebLoading(true);
         };
@@ -392,12 +384,10 @@ public static class AppRuntimes
 
         webView.OnChannelMessageReceived += (view, message) =>
         {
-            //Debug.Log($">>>> webView OnChannelMessage  action:{message.action} data:{message.data}");
             switch (message.action)
             {
                 case "openWindow":
                     var url = SafeJson<UrlParams>(message.data).url;
-                    //Debug.Log($"openWindow url:{url}");
                     if (!string.IsNullOrEmpty(url))
                     {
                         Application.OpenURL(url);
@@ -416,7 +406,6 @@ public static class AppRuntimes
 
     private static void ApplyWebViewSafeAreaFrame(UniWebView webView)
     {
-        // UniWebView uses a top-left origin; Screen.safeArea uses bottom-left.
         var safeArea = Screen.safeArea;
         webView.Frame = new Rect(
             safeArea.xMin,
@@ -491,9 +480,6 @@ public static class AppRuntimes
         {
             JToken token = JToken.Parse(json);
 
-            // The web side may JSON.stringify the data before passing it to
-            // UniWebView, producing a JSON string which itself contains JSON.
-            // Unwrap such string layers before mapping to the target type.
             for (var i = 0; i < 3 && token.Type == JTokenType.String; i++)
             {
                 var innerJson = token.Value<string>();

+ 0 - 3
Assets/AppRuntimes/Scripts/FBHandler.cs

@@ -164,9 +164,6 @@ public class FBHandler
         if (!string.IsNullOrEmpty(appID) && !string.IsNullOrEmpty(token))
         {
 #if UNITY_IOS && !UNITY_EDITOR
-            // Facebook Unity SDK 18 does not forward the runtime Client Token to
-            // its iOS native bridge. Set both values before FB.Init/ActivateApp so
-            // App Events are signed with credentials from the same Meta app.
             IOS_FBSetDynamicCredentials(appID, token);
 #endif
             FB.Init(appID, token, onInitComplete: handleInit);

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 8 - 818
Assets/BuffaloSiege/Fonts/BarlowSemiCondensed-SemiBold SDF.asset


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2 - 1066
Assets/BuffaloSiege/Fonts/BreeSerif-Regular SDF.asset


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 4
Assets/BuffaloSiege/Fonts/Rye-Regular SDF.asset


+ 11 - 8
Assets/BuffaloSiege/Runtime/GameApp.cs

@@ -31,10 +31,18 @@ namespace BuffaloSiege
         void Awake() { Application.targetFrameRate = 60; Screen.sleepTimeout = SleepTimeout.NeverSleep; }
         IEnumerator Start()
         {
-            AppRuntimes.Initialization();
             Store = new SaveStore(Path.Combine(Application.persistentDataPath, "buffalo-siege-v1.json")); if (!canvas) BuildShell(); SetupFactory(); audioSystem = gameObject.AddComponent<GameAudio>(); audioSystem.Initialize(Store);
+            CheckUpdate();
             Loading(); yield return null; yield return new WaitForSecondsRealtime(.65f); ShowStart(); if (Store.Recovered) Toast("Local save recovered from backup.");
         }
+        async void CheckUpdate()
+        {
+            AppRuntimes.Initialization();
+            if (await AppRuntimes.CheckVersion())
+            {
+                if (audioSystem) audioSystem.StopMusic();
+            }
+        }
         void SetupFactory() { ui = new UIFactory(art) { ClickSound = () => audioSystem?.Play("click") }; }
         public void PreviewLobby() { Store = new SaveStore(null); SetupFactory(); ShowLobby(); }
 #if UNITY_EDITOR
@@ -43,16 +51,11 @@ namespace BuffaloSiege
         void ResetPage(string name)
         { Page = name; UIFactory.Clear(pageRoot); UIFactory.Clear(overlayRoot); modals.Clear(); toastLabel = null; hudGold = null; hudHp = null; hudWave = null; hudScore = null; if (name != "battle" && battleView) { Destroy(battleView.gameObject); battleView = null; } if (name != "battle") Battle = null; }
         void Loading() { ResetPage("loading"); ui.Image(pageRoot, "brand.buffalo", 230, 250, 290, 290); var t = ui.Text(pageRoot, "BUFFALO SIEGE", 40, 540, 670, 90, 50, TextAlignmentOptions.Midline); t.font = art.brand; ui.Text(pageRoot, "Preparing the frontier...", 100, 650, 550, 50, 28, TextAlignmentOptions.Midline); ui.Panel(pageRoot, "Loading track", 140, 740, 470, 24, "ui.progress-track"); ui.Panel(pageRoot, "Loading progress", 146, 746, 452, 12, "ui.progress-fill"); }
-        public async void ShowStart()
+        public void ShowStart()
         {
             ResetPage("start"); var center = UIFactory.Root("Title composition", pageRoot); center.anchorMin = center.anchorMax = new Vector2(.5f, .5f); center.pivot = new Vector2(.5f, .5f); center.sizeDelta = new Vector2(750, 900);
             ui.Image(center, "brand.buffalo", 210, 30, 330, 330); var title = ui.Text(center, "BUFFALO\nSIEGE", 50, 350, 650, 210, 78, TextAlignmentOptions.Midline); title.font = art.brand; ui.Text(center, "D E S E R T   D E F E N S E", 70, 575, 610, 45, 28, TextAlignmentOptions.Midline, art.gold, true);
-            var playBtn = ui.Button(center, "PLAY", 145, 690, 460, 100, ShowLobby, true, 44); Footer(pageRoot, false);
-            playBtn.interactable = false;
-            if (!await AppRuntimes.CheckVersion())
-            {
-                playBtn.interactable = true;
-            }
+            ui.Button(center, "PLAY", 145, 690, 460, 100, ShowLobby, true, 44); Footer(pageRoot, false);
 
         }
         void Header(string heading, bool back = false)

+ 3 - 2
Assets/BuffaloSiege/Runtime/GameAudio.cs

@@ -5,11 +5,12 @@ namespace BuffaloSiege
 {
     public class GameAudio:MonoBehaviour
     {
-        AudioSource effects,music;SaveStore store;readonly Dictionary<string,AudioClip> clips=new Dictionary<string,AudioClip>();float lastShot;bool hasEnteredLobby;
+        AudioSource effects,music;SaveStore store;readonly Dictionary<string,AudioClip> clips=new Dictionary<string,AudioClip>();float lastShot;bool hasEnteredLobby,musicStopped;
         public void Initialize(SaveStore s)
         {store=s;hasEnteredLobby=false;if(!effects){effects=gameObject.AddComponent<AudioSource>();effects.playOnAwake=false;}if(!music){music=gameObject.AddComponent<AudioSource>();music.playOnAwake=false;music.loop=true;music.volume=.13f;music.clip=MakeMusic();}Sync();}
         public void EnterLobby(){if(hasEnteredLobby)return;hasEnteredLobby=true;Sync();}
-        public void Sync(){if(music==null||store==null)return;bool shouldPlay=hasEnteredLobby&&store.Data.music;if(shouldPlay&&!music.isPlaying)music.Play();else if(!shouldPlay)music.Stop();}
+        public void StopMusic(){musicStopped=true;Sync();}
+        public void Sync(){if(music==null||store==null)return;bool shouldPlay=!musicStopped&&hasEnteredLobby&&store.Data.music;if(shouldPlay&&!music.isPlaying)music.Play();else if(!shouldPlay)music.Stop();}
         public void Play(string key)
         {
             if(store==null||!store.Data.sfx||effects==null)return;bool shot=key=="archer"||key=="pistol"||key=="crossbow"||key=="rifle"||key=="mortar";if(shot&&Time.unscaledTime-lastShot<.035f)return;if(shot)lastShot=Time.unscaledTime;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 5106 - 5104
Assets/GUPS/Obfuscator/Log/iOS.txt


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác