Ejemplo n.º 1
0
 public static void ui_return_sceneSwitch(Action callback = null)
 {
     if (SceneModels.instance != null)
     {
         SceneModels.instance.destoryTempParent();
     }
     AppOpera.SetOperaToLoop();
     if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.demo_pc)
     {
         if (SceneManager.GetActiveScene().name != "SceneSwitchInteral")
         {
             SceneManager.LoadScene("SceneSwitchInteral");
         }
     }
     else
     {
         if (SceneManager.GetActiveScene().name != "SceneSwitch")
         {
             SceneManager.LoadScene("SceneSwitch");
         }
     }
     PublicClass.app = null;
     if (callback != null)
     {
         callback();
     }
 }
Ejemplo n.º 2
0
        //从unity切换界面到android平台的方法

        public static void ui_return_to_platform(string type = null, string content = null)
        {
            try
            {
                if (SceneModels.instance != null)
                {
                    SceneModels.instance.destoryTempParent();
                }


                AppOpera.SetOperaToLoop();
                if (PPTGlobal.PPTEnv == PPTGlobal.PPTEnvironment.demo_pc)
                {
                    if (SceneManager.GetActiveScene().name != "SceneSwitchInteral")
                    {
                        SceneManager.LoadScene("SceneSwitchInteral");
                    }
                }
                else
                {
                    if (SceneManager.GetActiveScene().name != "SceneSwitch")
                    {
                        SceneManager.LoadScene("SceneSwitch");
                    }
                }
    #if UNITY_EDITOR || UNITY_STANDALONE_WIN
                ui_return_to_platform_for_win();
    #elif UNITY_IOS
                if (type != null && content != null)
                {
                    send_message_to_platform_for_ios(type, content);
                }
                ui_return_to_platform_for_ios();
    #elif UNITY_ANDROID
                if (type != null && content != null)
                {
                    send_message_to_platform_for_android(type, content);
                }
                ui_return_to_platform_for_android();
    #else
    #endif
            }
            catch (Exception e)
            {
                Debug.Log(e.Message);
                Debug.Log(e.StackTrace);
            }
        }