This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using UnityEngine; | |
public class BaseBehaviour : MonoBehaviour | |
{ | |
protected virtual void OnEnable() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NuGet Microsoft.AspNet.Cors (5.2.7) | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddCors(options => | |
options.AddDefaultPolicy(builder => | |
builder | |
.AllowAnyOrigin() // .WithOrigins(...) if .AllowCredentials | |
.AllowAnyMethod() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using UnityEditor; | |
public static class PowerShellOpener | |
{ | |
[MenuItem("Tools/PowerShell")] | |
private static void NewMenuOption() | |
{ | |
var process = new ProcessStartInfo("powershell.exe") | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public class AsepriteUnityImporter : AssetPostprocessor | |
{ | |
static void OnPostprocessAllAssets( | |
string[] importedAssets, | |
string[] deletedAssets, | |
string[] movedAssets, | |
string[] movedFromAssetPaths) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.DependencyInjection; | |
using System; | |
using Xunit; | |
namespace UnitTests | |
{ | |
public class ActivatorUtilitiesConstructorTests | |
{ | |
public class Dependency1 { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
{ | |
public static void Bar<TZoom>(TZoom zoom) where TZoom : IZoom { } | |
public static void Bar<TBoom, TLoom>(TBoom boom) where TBoom : IBoom<TLoom> { } | |
} | |
interface IZoom { } | |
interface IBoom<T> { } | |
class Zoom1 : IZoom { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configure all named options without dependencies. | |
services.ConfigureAll<TOptions>(options => | |
{ | |
// Set your options here. | |
}); | |
// Configure all named options with dependencies. | |
// Setting name to null is a key here. | |
services.AddSingleton<IConfigureOptions<TOptions>>(provider => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddSingleton<IConfigureOptions<HttpClientFactoryOptions>>(provider => | |
{ | |
return new ConfigureNamedOptions<HttpClientFactoryOptions>(name: null, options => | |
{ | |
options.HttpMessageHandlerBuilderActions.Add(builder => | |
{ | |
builder.AdditionalHandlers.Add(provider.GetRequiredService<YourHandler>()); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<ItemGroup> | |
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | |
<_Parameter1>$(AssemblyName).Tests</_Parameter1> | |
</AssemblyAttribute> | |
</ItemGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<ItemGroup> | |
<!-- Copies all content from wwwroot folder to output folder specified in LinkBase --> | |
<None Include="wwwroot\**" Exclude="wwwroot\**\*.cs" CopyToOutputDirectory="Always" LinkBase="wwwroot\" /> | |
<!-- If above dosn't work, maybe non-SDK style project, or solution has some non-SDK style projects, try this --> | |
<None Include="wwwroot\**" CopyToOutputDirectory="Always" Link="wwwroot/%(RecursiveDir)%(Filename)%(Extension)" /> | |
</ItemGroup> | |
</Project> |
OlderNewer