Beispiel #1
0
    private void CreateGameModules()
    {
        // 创建事件管理器
        MotionEngine.CreateModule <EventManager>();

        // 创建网络管理器
        var networkCreateParam = new NetworkManager.CreateParameters();

        networkCreateParam.PackageCoderType = typeof(ProtoPackageCoder);
        MotionEngine.CreateModule <NetworkManager>(networkCreateParam);

        // 创建资源管理器
        var resourceCreateParam = new ResourceManager.CreateParameters();

        resourceCreateParam.LocationRoot        = GameDefine.AssetRootPath;
        resourceCreateParam.SimulationOnEditor  = SimulationOnEditor;
        resourceCreateParam.BundleServices      = new LocalBundleServices();
        resourceCreateParam.DecryptServices     = null;
        resourceCreateParam.AutoReleaseInterval = 10f;
        MotionEngine.CreateModule <ResourceManager>(resourceCreateParam);

        // 创建音频管理器
        MotionEngine.CreateModule <AudioManager>();

        // 创建场景管理器
        MotionEngine.CreateModule <SceneManager>();

        // 创建对象池管理器
        MotionEngine.CreateModule <GameObjectPoolManager>();

        // 直接进入游戏
        MotionEngine.CreateModule <LuaManager>();
    }
    /// <summary>
    /// 创建游戏模块
    /// </summary>
    private IEnumerator CreateGameModules()
    {
        // 创建事件管理器
        MotionEngine.CreateModule <EventManager>();

        // 创建补间管理器
        MotionEngine.CreateModule <TweenManager>();

        // 创建网络管理器
        var networkCreateParam = new NetworkManager.CreateParameters();

        networkCreateParam.PackageCoderType = typeof(ProtoPackageCoder);
        networkCreateParam.PackageMaxSize   = ushort.MaxValue;
        MotionEngine.CreateModule <NetworkManager>(networkCreateParam);

        // 创建补丁管理器
        PatchManager.OfflinePlayModeParameters patchCreateParam = new PatchManager.OfflinePlayModeParameters();
        patchCreateParam.SimulationOnEditor = SimulationOnEditor;
        MotionEngine.CreateModule <PatchManager>(patchCreateParam);
        var operation = PatchManager.Instance.InitializeAsync();

        yield return(operation);

        // 创建资源管理器
        var resourceCreateParam = new ResourceManager.CreateParameters();

        resourceCreateParam.LocationRoot        = GameDefine.AssetRootPath;
        resourceCreateParam.SimulationOnEditor  = SimulationOnEditor;
        resourceCreateParam.BundleServices      = PatchManager.Instance.BundleServices;
        resourceCreateParam.DecryptServices     = null;
        resourceCreateParam.AutoReleaseInterval = 10f;
        MotionEngine.CreateModule <ResourceManager>(resourceCreateParam);

        // 创建配表管理器
        MotionEngine.CreateModule <ConfigManager>();

        // 创建音频管理器
        MotionEngine.CreateModule <AudioManager>();

        // 创建场景管理器
        MotionEngine.CreateModule <SceneManager>();

        // 创建窗口管理器
        MotionEngine.CreateModule <WindowManager>();

        // 创建ILR管理器
        ILRManager.CreateParameters createParameters = new ILRManager.CreateParameters();
        createParameters.IsEnableILRuntime  = EnableILRuntime;
        createParameters.SimulationOnEditor = SimulationOnEditor;
        MotionEngine.CreateModule <ILRManager>(createParameters);

        // 反射服务服务接口
        ConfigManager.Instance.ActivatorServices = ILRManager.Instance;
        WindowManager.Instance.ActivatorServices = ILRManager.Instance;

        // 开始游戏
        ILRManager.Instance.StartGame();
    }
    /// <summary>
    /// 创建游戏模块
    /// </summary>
    private IEnumerator CreateGameModules()
    {
        // 创建事件管理器
        MotionEngine.CreateModule <EventManager>();

        // 创建网络管理器
        var networkCreateParam = new NetworkManager.CreateParameters();

        networkCreateParam.PackageCoderType = typeof(ProtoPackageCoder);
        networkCreateParam.PackageMaxSize   = ushort.MaxValue;
        MotionEngine.CreateModule <NetworkManager>(networkCreateParam);

        // 本地资源服务接口
        LocalBundleServices bundleServices = new LocalBundleServices();

        yield return(bundleServices.InitializeAsync(SimulationOnEditor));

        // 创建资源管理器
        var resourceCreateParam = new ResourceManager.CreateParameters();

        resourceCreateParam.LocationRoot        = GameDefine.AssetRootPath;
        resourceCreateParam.SimulationOnEditor  = SimulationOnEditor;
        resourceCreateParam.BundleServices      = bundleServices;
        resourceCreateParam.DecryptServices     = null;
        resourceCreateParam.AutoReleaseInterval = 10f;
        MotionEngine.CreateModule <ResourceManager>(resourceCreateParam);

        // 创建音频管理器
        MotionEngine.CreateModule <AudioManager>();

        // 创建场景管理器
        MotionEngine.CreateModule <SceneManager>();

        // 创建对象池管理器
        MotionEngine.CreateModule <GameObjectPoolManager>();

        // 创建ILR管理器
        ILRManager.CreateParameters createParameters = new ILRManager.CreateParameters();
        createParameters.IsEnableILRuntime = EnableILRuntime;
        MotionEngine.CreateModule <ILRManager>(createParameters);

        // 开始游戏
        ILRManager.Instance.StartGame();
    }
Beispiel #4
0
    private IEnumerator CreateGameModules()
    {
        // 创建事件管理器
        MotionEngine.CreateModule <EventManager>();

        // 创建网络管理器
        var networkCreateParam = new NetworkManager.CreateParameters();

        networkCreateParam.PackageCoderType = typeof(ProtoPackageCoder);
        MotionEngine.CreateModule <NetworkManager>(networkCreateParam);

        // 创建补丁管理器
        var patchCreateParam = new PatchManager.OfflinePlayModeParameters();

        patchCreateParam.SimulationOnEditor = SimulationOnEditor;
        MotionEngine.CreateModule <PatchManager>(patchCreateParam);
        var operation = PatchManager.Instance.InitializeAsync();

        yield return(operation);

        // 创建资源管理器
        var resourceCreateParam = new ResourceManager.CreateParameters();

        resourceCreateParam.LocationRoot        = GameDefine.AssetRootPath;
        resourceCreateParam.SimulationOnEditor  = SimulationOnEditor;
        resourceCreateParam.BundleServices      = PatchManager.Instance.BundleServices;
        resourceCreateParam.DecryptServices     = null;
        resourceCreateParam.AutoReleaseInterval = 10f;
        MotionEngine.CreateModule <ResourceManager>(resourceCreateParam);

        // 创建音频管理器
        MotionEngine.CreateModule <AudioManager>();

        // 创建场景管理器
        MotionEngine.CreateModule <SceneManager>();

        // 直接进入游戏
        MotionEngine.CreateModule <LuaManager>();
        LuaManager.Instance.StartGame();
    }
Beispiel #5
0
    private IEnumerator CreateGameModules()
    {
        // 创建事件管理器
        MotionEngine.CreateModule <EventManager>();

        // 创建网络管理器
        var networkCreateParam = new NetworkManager.CreateParameters();

        networkCreateParam.PackageCoderType = typeof(ProtoPackageCoder);
        MotionEngine.CreateModule <NetworkManager>(networkCreateParam);

        // 本地资源服务接口
        LocalBundleServices bundleServices = new LocalBundleServices();

        yield return(bundleServices.InitializeAsync(SimulationOnEditor));

        // 创建资源管理器
        var resourceCreateParam = new ResourceManager.CreateParameters();

        resourceCreateParam.LocationRoot        = GameDefine.AssetRootPath;
        resourceCreateParam.SimulationOnEditor  = SimulationOnEditor;
        resourceCreateParam.BundleServices      = bundleServices;
        resourceCreateParam.DecryptServices     = null;
        resourceCreateParam.AutoReleaseInterval = 10f;
        MotionEngine.CreateModule <ResourceManager>(resourceCreateParam);

        // 创建音频管理器
        MotionEngine.CreateModule <AudioManager>();

        // 创建场景管理器
        MotionEngine.CreateModule <SceneManager>();

        // 直接进入游戏
        var luaCreateParam = new LuaManager.CreateParameters();

        luaCreateParam.SimulationOnEditor = SimulationOnEditor;
        MotionEngine.CreateModule <LuaManager>(luaCreateParam);
        LuaManager.Instance.StartGame();
    }