Skip to content

Instantly share code, notes, and snippets.

View SonicZentropy's full-sized avatar

Casey Bailey SonicZentropy

View GitHub Profile
@SonicZentropy
SonicZentropy / FPSCounter.cs
Created November 28, 2017 05:17
Non-Shitty Unity FPS Counter
namespace Zen.Common.Debug
{
#region Dependencies
using UnityEngine;
#endregion
public class FpsCounter : MonoBehaviour
{
private Dictionary<ComponentTypesEnum, List<ComponentEcs>> _componentPools =
new Dictionary<ComponentTypes, List<ComponentEcs>>(new FastEnumIntEqualityComparer<ComponentTypes>()); // This is the custom comparator passed into the dict constructor
struct FastEnumIntEqualityComparer<TEnum> : IEqualityComparer<TEnum>
where TEnum : struct
{
static class BoxAvoidance
{
static readonly Func<TEnum, int> _wrapper;
#pragma warning disable 0414, 0219, 649, 169, 1570
using System;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
public enum Tags : long
{
None = 0,
Player = 1 << 0,
@SonicZentropy
SonicZentropy / AbstractComponent.cs
Last active October 20, 2016 01:46 — forked from will-hart/AbstractComponent.cs
Sentry ECS - a simple public domain entity component system
public abstract class AbstractComponent : IComponent
{
[NonSerialized]
protected readonly Entity _owner;
public AbstractComponent(Entity owner)
{
_owner = owner;
ID = Guid.NewGuid().ToString("n");
}
@SonicZentropy
SonicZentropy / CustomAHK.ahk
Created March 15, 2016 01:17
Ableton AHK Script
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#KeyHistory 100
; #Warn ; Enable warnings to assist with detecting common errors.
SetTitleMatchMode, fast
SetTitleMatchMode, 2
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Persistent
#IfWinActive Ableton Live 9 Suite
^WheelUp::