Skip to content

Instantly share code, notes, and snippets.

View jbubriski's full-sized avatar

John Bubriski jbubriski

View GitHub Profile
@jbubriski
jbubriski / BuildSceneProcessor.cs
Created November 8, 2016 16:23 — forked from mrcarriere/BuildSceneProcessor.cs
Automatically add a scene to your Build Settings when you create or save the scene. Scenes that are ignored will not re-prompt for the current session.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
// docs: https://docs.unity3d.com/ScriptReference/AssetModificationProcessor.OnWillSaveAssets.html
public class BuildSceneProcessor : UnityEditor.AssetModificationProcessor
{
private const string DIALOG_TITLE = "Add to Build Settings?";
private const string DIALOG_MSG = "Add to build settings for inclusion in future builds?";
@jbubriski
jbubriski / LightFlickerEffect.cs
Created September 10, 2021 19:44 — forked from sinbad/LightFlickerEffect.cs
Unity simple & fast light flicker script
using UnityEngine;
using System.Collections.Generic;
// Written by Steve Streeting 2017
// License: CC0 Public Domain http://creativecommons.org/publicdomain/zero/1.0/
/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
@jbubriski
jbubriski / CollectionExtensions.cs
Created June 2, 2021 18:05 — forked from codeimpossible/CollectionExtensions.cs
Sound Effect Scriptable Object
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace NoirLib {
public static class CollectionExtensions {
private static readonly System.Random _rand = new System.Random();
public static T Random<T>(this T[] items) {
<rewrite>
<!-- Have a bunch of redirects? Put them in a separate file -->
<rules configSource="Rewrites.config" />
<rules>
<!-- Simple rewrite -->
<rule name="Simple redirect" stopProcessing="true">
<match url="^path/sub path/page\.aspx$" />
<action type="Rewrite" url="/newpath.aspx" />
@jbubriski
jbubriski / GameManager.cs
Created November 23, 2017 00:03 — forked from codeimpossible/GameManager.cs
Cross Platform GamePad Input for Unity
using System;
using UnityEngine;
public class GameManager : MonoBehaviour {
public IInputSystem Input;
public static GameManager Instance;
void Awake() {
@jbubriski
jbubriski / BehaviourButtonsEditor
Created November 17, 2016 15:45
Add editor buttons to your MonoBehaviours methods
using UnityEditor;
using UnityEngine;
namespace BitStrap
{
/// <summary>
/// Custom editor for all MonoBehaviour scripts in order to draw buttons for all button attributes (<see cref="ButtonAttribute"/>).
/// </summary>
[CustomEditor( typeof( MonoBehaviour ), true, isFallback = true )]
[CanEditMultipleObjects]
@jbubriski
jbubriski / StopPlayingOnRecompile.cs
Created November 8, 2016 16:23 — forked from mrcarriere/StopPlayingOnRecompile.cs
Force Unity to stop playing if you have edited a source file. Helps avoid some editor crashes and false positives / error spam. To use, drop this script in an "Editor" folder in your project.
using UnityEditor;
[InitializeOnLoad]
public class StopPlayingOnRecompile
{
static StopPlayingOnRecompile()
{
EditorApplication.update += () =>
{
if (EditorApplication.isCompiling && EditorApplication.isPlaying)
body {
margin: 0px;
padding: 0px;
}
#player {
width: 100%;
height: 100%;
}
@jbubriski
jbubriski / menus.js
Created January 14, 2016 16:52 — forked from phoboslab/menus.js
Z-Type Menu
ig.module(
'game.menus'
)
.requires(
'impact.font'
)
.defines(function(){
MenuItem = ig.Class.extend({
getText: function(){ return 'none' },

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.