Skip to content

Instantly share code, notes, and snippets.

@erineccleston
erineccleston / OrthographicOverride.cs
Last active August 7, 2019 21:45
Allows 2D Pixel Perfect to work with Cinemachine
using Cinemachine;
using UnityEngine;
using UnityEngine.U2D;
using System.Reflection;
/// <summary>
/// Add this component to a camera that has PixelPerfectCamera and CinemachineBrain
/// components to prevent the active CinemachineVirtualCamera from overwriting the
/// correct orthographic size as calculated by the PixelPerfectCamera.
/// </summary>
@erineccleston
erineccleston / ConsoleTetris.cs
Created May 12, 2018 08:40
Tetris (with theme song) in the C# console.
// Erin Eccleston 2018
// Still buggy, btw...
using System;
using System.Timers;
using static System.Console;
using System.Collections.Generic;
static class Tetris
{
create 15 x 6 2d array // let top left tile be (0, 0)
create vectors of coordinates named zonetransition, hallway, 3way, 4way, endcap
place tile of type room173 at (7, 5)
roll 1d3 +2 for number of zone transitions
generate that number of random numbers in range 0 to 14, difference between each number must be >1
generate start index offset in range 0 to (14 - max of those numbers)