Example #1
0
    public void DeselectAll()
    {
        if (EventSystem.current.currentSelectedGameObject != null)
        {
            var go = EventSystem.current.currentSelectedGameObject;

            if (go.GetComponent <InventoryAbility>() != null)
            {
                InventoryAbility ability = go.GetComponent <InventoryAbility>();
                ability.ForceDeselect();
            }
            if (go.GetComponent <InventorySeed>() != null)
            {
                InventorySeed seed = go.GetComponent <InventorySeed>();
                seed.ForceDeselect();
            }
            if (go.GetComponent <InventoryTrinket>() != null)
            {
                InventoryTrinket trinket = go.GetComponent <InventoryTrinket>();
                trinket.ForceDeselect();
            }
        }
    }
Example #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, Seed seeder, InventorySeed seeder1)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                // app.UseHsts();
                app.UseExceptionHandler(builder => {
                    builder.Run(async context => {
                        context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;

                        var error = context.Features.Get <IExceptionHandlerFeature>();

                        if (error != null)
                        {
                            context.Response.AddApplicationError(error.Error.Message);
                            await context.Response.WriteAsync(error.Error.Message);
                        }
                    });
                });
            }

            // app.UseHttpsRedirection();
            //seeder.SeedUsers();
            //seeder1.SeedItems();
            app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
            app.UseAuthentication();
            app.UseMvc();
        }