Exemple #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseSwagger();
            app.UseSwaggerUI(a =>
            {
                a.SwaggerEndpoint("/swagger/v1/swagger.json", "MiaoMiaoTest API V1");
            });

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            FrameWorkConfig.Configure(app.ApplicationServices, Configuration, loggerFactory);
        }
Exemple #2
0
        void Awake()
        {
#if !UNITY_EDITOR
            OpenABMode = true;
#endif
            LogMgr.OpenLog = this.AwakeLogMode;
            GameObject fkObject = GameObject.Find("KFrameWork");

            if (fkObject == null)
            {
                this.gameObject.name = "KFrameWork";
            }

            if (Application.isPlaying)
            {
                DontDestroyOnLoad(gameObject);
            }

            _mIns     = this;
            initwatch = new Stopwatch();
            initwatch.Start();

            FrameWorkConfig.LoadConfig(this);
            if (AsyncInit)
            {
                cached = Resources.Load <RegisterCachedTypes>(MainLoopAsset);
                thread = new Thread(AsyncWork);
                thread.Start();
                //ThreadPool.QueueUserWorkItem(AsyncWork);
            }
            else
            {
                _Init();
                CheckEvents();
            }
        }