Esempio n. 1
0
        //---------------------------------------------------------------------
        public void Launch()
        {
            // 计算PathMgr中的动态目录
            bool version_persistent = false;

            if (!string.IsNullOrEmpty(Config.VersionCommonPersistent) && !string.IsNullOrEmpty(Config.VersionDataPersistent))
            {
                version_persistent = true;
            }
            if (!version_persistent)
            {
                PathMgr.DirLaunchAb     = "Resources.KingTexasLaunch/";
                PathMgr.DirLaunchAbType = DirType.Resources;
            }
            else
            {
                PathMgr.DirLaunchAb     = PathMgr.CombinePersistentDataPath("Resources.KingTexasLaunch/");
                PathMgr.DirLaunchAbType = DirType.Raw;
            }

            if (IsEditorDebug)
            {
                string p  = Path.Combine(System.Environment.CurrentDirectory, "./DataOss/");
                var    di = new DirectoryInfo(p);
                string p1 = di.FullName.Replace('\\', '/');

                string lua_root = System.Environment.CurrentDirectory + "/Assets/Script.Lua/";
                PathMgr.DirLuaRoot = lua_root.Replace('\\', '/');
                PathMgr.DirRawRoot = p1 + "Common/Raw/";
                PathMgr.DirAbRoot  = p1 + Config.Platform + "/Resources.KingTexas/";
            }
            else
            {
                PathMgr.DirLuaRoot = PathMgr.CombinePersistentDataPath("Lua/");
                PathMgr.DirRawRoot = PathMgr.CombinePersistentDataPath("Raw/");
                PathMgr.DirAbRoot  = PathMgr.CombinePersistentDataPath("Resources.KingTexas/");
            }

            PathMgr.DirCsRoot = PathMgr.CombinePersistentDataPath("Cs/");

            PathMgr.DirAbUi       = PathMgr.DirAbRoot + "Ui/";       // "Resources.KingTexas/Ui/",需动态计算
            PathMgr.DirAbCard     = PathMgr.DirAbRoot + "Cards/";    // "Resources.KingTexas/Cards/",需动态计算
            PathMgr.DirAbAudio    = PathMgr.DirAbRoot + "Audio/";    // "Resources.KingTexas/Audio/",需动态计算
            PathMgr.DirAbItem     = PathMgr.DirAbRoot + "Item/";     // "Resources.KingTexas/Item/",需动态计算
            PathMgr.DirAbParticle = PathMgr.DirAbRoot + "Particle/"; // "Resources.KingTexas/Particle/",需动态计算

            LuaMgr.Launch(!version_persistent);

            CsRuntime = new CasinosILRuntime();
            CsRuntime.Create();
        }
Esempio n. 2
0
        //---------------------------------------------------------------------
        public void Close()
        {
            //if (TimerShaft != null)
            //{
            //    TimerShaft.Destroy();
            //    TimerShaft = null;
            //}

            if (SoundMgr != null)
            {
                SoundMgr.Destroy();
                SoundMgr = null;
            }

            if (HeadIconMgr != null)
            {
                HeadIconMgr.Destroy();
                HeadIconMgr = null;
            }

            if (SpineMgr != null)
            {
                SpineMgr.Destroy();
                SpineMgr = null;
            }

            if (NetMgr != null)
            {
                NetMgr.Close();
                NetMgr = null;
            }

            if (NativeAPIMsgReceiverListner != null)
            {
                NativeAPIMsgReceiverListner.Close();
                NativeAPIMsgReceiverListner = null;
            }

            if (CsRuntime != null)
            {
                CsRuntime.Destroy();
                CsRuntime = null;
            }

            if (LuaMgr != null)
            {
                LuaMgr.Release();
                LuaMgr = null;
            }

            if (DelayMgr != null)
            {
                DelayMgr.Close();
                DelayMgr = null;
            }

            if (MemoryStream != null)
            {
                MemoryStream.Close();
                MemoryStream = null;
            }

            Screen.sleepTimeout = SleepTimeout.SystemSetting;
        }