Skip to content

Instantly share code, notes, and snippets.

View brainwipe's full-sized avatar

Rob Lang brainwipe

View GitHub Profile
@brainwipe
brainwipe / MissingBehaviourRemover.cs
Created June 24, 2022 20:24
Unity Editor Tool for Removing Missing Behaviours
//
// To use: copy this file into a folder called Assets/Editor, return to Unity. Go to Window->Missing Behaviour Remover and a window will popup; follow instructions below.
//
#if (UNITY_EDITOR)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
@brainwipe
brainwipe / snap.svg.text.in.a.box.html
Last active May 27, 2022 00:03
Using Snap.svg to create a box with text in it. The bounding "container" box expands to fit the width of the text.
<html>
<head>
<script src="//cdn.jsdelivr.net/snap.svg/0.1.0/snap.svg-min.js"></script>
<script>
var s = Snap("#svg");
var block = s.rect(50, 50, 100, 100, 20, 20);
block.attr({
fill: "rgb(236, 240, 241)",
stroke: "#1f2c39",
@brainwipe
brainwipe / PIDController.cs
Created February 12, 2022 21:02
Unity C# PID Controller Example
using System;
using UnityEngine;
namespace Lang.Clomp.Infrastructure
{
[Serializable]
internal class PIDController
{
private readonly float cumulativeErrorLimit;
private float cumulativeError;
@brainwipe
brainwipe / CreateAndSavePrefab.cs
Last active December 5, 2021 15:01
Creating and Saving Unity Prefabs
/*
Unity C# Psudocode to show how to create a mesh, save it as an asset and then attach it to a prefab.
by Rob Lang https://www.youtube.com/roblang
*/
#if (UNITY_EDITOR)
using UnityEditor;
using UnityEngine;
@brainwipe
brainwipe / devlogtemplate.md
Last active August 5, 2021 21:09
Rob Lang's Game Dev log Template

NUMBER

Intro

Body

Outro

Until next time, bye bye.

YT Thumbnail Text

@brainwipe
brainwipe / Coordinate.cs
Created January 2, 2021 11:17
Struct for Managing Coordinates
/* By Rob Lang
MIT License
https://www.youtube.com/roblang
@brainwipe */
/*
Example Use:
Dictionary<Coordinate, GameObject> grid = new Dictionary<Coordinate, GameObject>();
grid[(0,1)] = new GameObject();
grid[new Coordinate(1,1)] = new GameObject();
@brainwipe
brainwipe / EventAggregator.cs
Created May 16, 2020 06:17
A fail-fast lightweight event Event Aggregator for Pub/Sub
using System;
using System.Collections;
using System.Collections.Generic;
// From https://www.youtube.com/channel/UCHg8bDmXIYKAwvyc4yMGuUw
namespace Lang.Utility
{
public interface IEvent {}
public class EventAggregator
@brainwipe
brainwipe / Fourpersontoken.md
Created November 6, 2019 21:47
The four person token

Rob Byrn Aggro Jen

@brainwipe
brainwipe / BloggerToMarkdown.cs
Created October 17, 2018 22:04
Converts Blogger export XML and converts to Markdown
// Requires nuget Package https://www.nuget.org/packages/Html2Markdown/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using Html2Markdown;
@brainwipe
brainwipe / gwt.snippet
Last active June 29, 2018 08:38
Unit Test code snippet for Visual Studio 2017 using Given, When, Then and Arrange, Act and Assert
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Keywords>
<Keyword>unit</Keyword>
<Keyword>test</Keyword>
<Keyword>given</Keyword>
<Keyword>when</Keyword>
<Keyword>then</Keyword>