Skip to content

Instantly share code, notes, and snippets.

@Arakade
Arakade / CollisionHelper.cs
Created April 23, 2020 13:06
Log when collisions and triggers are entered and exited.
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine.Assertions;
using UnityEngine;
namespace UGS.unityutils {
/// <summary>
/// Log when collisions and triggers are entered and exited.
/// </summary>
public sealed class CollisionHelper : MonoBehaviour {
@Arakade
Arakade / Command.ts
Created November 13, 2020 16:24
AJV TypeScript JSONSchemaType requires methods?
/**
* Enumeration of valid commands.
*/
export type Command = 'RegisterGame' | 'GameToController' | 'ControllerToGame';
@Arakade
Arakade / AoC-2020-day5.ts
Created December 5, 2020 14:28
Advent of Code 2020, Day 5 TypeScript (functional style)
// Advent of code 2020, Day 5
import fs from 'fs';
import assert from 'assert';
function convertStringToSeatId(seatCode: string): number {
return (Array.prototype.map.call(seatCode, (c: string): number => {
switch (c) {
case 'F':
case 'L':
@Arakade
Arakade / ButtonAndMouseInEditor.cs
Created March 9, 2021 11:51
Unity3D Editor OnSceneGUI() code for detecting mouse-press while key held changed in 2020.2.7f1 (at least)
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
// pre C#8
//#nullable enable
public sealed class ButtonAndMouseInEditor : MonoBehaviour {