Ver Fonte

增加:游戏中途返回主页接口

lvjincheng há 2 anos atrás
pai
commit
52cc67e76f

+ 8 - 0
Assets/BowArrow/Scripts/Standalone.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2c62f6aba6189f647a7ea728502a2aca
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 22 - 0
Assets/BowArrow/Scripts/Standalone/StandaloneAPI.cs

@@ -0,0 +1,22 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+public class StandaloneAPI
+{
+    public static void ForceBackHome()
+    {
+        SceneManager.LoadScene("Home", LoadSceneMode.Single);
+        if (PersistenHandler.ins)
+        {
+            var views = PersistenHandler.ins.menuBackCtr.views;
+            while (views.Count > 0)
+            {
+                var view = views[views.Count - 1];
+                views.RemoveAt(views.Count - 1);
+                view.OnMenuBack();
+            }
+        }
+    }
+}

+ 11 - 0
Assets/BowArrow/Scripts/Standalone/StandaloneAPI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 103b068ff1c0af34bbf8d2ea11302a5f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: