This file contains hidden or 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
Shader "Unlit/Circle" | |
{ | |
Properties | |
{ | |
_Radius ("Radius", Float) = 1.0 | |
_Thickness ("Thickness", Float) = 0.1 | |
_InnerColor ("InnerColor", Color) = (1,1,1,0.5) | |
_OuterColor ("OuterColor", Color) = (1,1,1,1) | |
} | |
SubShader |
This file contains hidden or 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
public static float Calc(float referenceFrequency, float noteOffset) // For instance: Calc(440, 12) = 880 | 440Hz = A4 | 880Hz = A5 | |
{ | |
return (float) (Math.Pow(2, noteOffset / 12) * referenceFrequency); | |
} |
This file contains hidden or 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.IO; | |
public static class GetApplicationDataPath | |
{ | |
public static string Get() | |
{ | |
return Path.Combine(Directory.GetCurrentDirectory(), "Assets").Replace('\\', '/'); | |
} | |
} |
This file contains hidden or 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
public struct Frequency | |
{ | |
private readonly long _millihertz; | |
public double Hertz => _millihertz / 1000d; | |
public TimeSpan Interval => TimeSpan.FromSeconds(1d / Hertz); | |
public Frequency(long millihertz) | |
{ |
This file contains hidden or 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
New-NetFirewallRule -DisplayName "Unity Cache Server" -Direction Outbound -RemotePort 10080 -Protocol TCP -Action Block |
This file contains hidden or 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
// From Unity wiki: http://wiki.unity3d.com/index.php/Show_Built_In_Resources | |
using System; | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
public class BuiltInResourcesWindow : EditorWindow | |
{ | |
[MenuItem("Window/Built-in styles and icons")] |
This file contains hidden or 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
public class CallbackAssertion | |
{ | |
private int _calls; | |
private readonly Action _call; | |
public CallbackAssertion() | |
{ | |
_call = () => _calls++; | |
} |
This file contains hidden or 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
internal sealed class InjectedMethodInfo | |
{ | |
public readonly MethodInfo MethodInfo; | |
public readonly ParameterInfo[] Parameters; | |
public readonly Action<object, object[]> Call; | |
public InjectedMethodInfo(MethodInfo methodInfo) | |
{ | |
MethodInfo = methodInfo; | |
Parameters = methodInfo.GetParameters(); |
This file contains hidden or 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
internal sealed class InjectedPropertyInfo | |
{ | |
public readonly Type PropertyType; | |
public readonly Action<object, object> Setter; | |
public InjectedPropertyInfo(PropertyInfo propertyInfo) | |
{ | |
PropertyType = propertyInfo.PropertyType; | |
Setter = GenerateSetter(propertyInfo); | |
} |
This file contains hidden or 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 UnityEngine; | |
public static class GetBoundsAtScreenSpace | |
{ | |
private static readonly List<Vector3> _localSpaceVerticesBuffer = new List<Vector3>(); | |
public static Bounds Get(MeshFilter meshFilter, Camera camera) | |
{ |
NewerOlder