This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
public class GameManager : MonoBehaviour { | |
public IInputSystem Input; | |
public static GameManager Instance; | |
void Awake() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
[InitializeOnLoad] | |
public class StopPlayingOnRecompile | |
{ | |
static StopPlayingOnRecompile() | |
{ | |
EditorApplication.update += () => | |
{ | |
if (EditorApplication.isCompiling && EditorApplication.isPlaying) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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?"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bind keyboard and gamepad buttons | |
ig.input.bind( ig.KEY.X, 'shoot1'); | |
ig.input.bind( ig.GAMEPAD1.FACE_1, 'shoot1'); | |
ig.input.bind( ig.GAMEPAD2.FACE_1, 'shoot2'); | |
ig.input.bind( ig.GAMEPAD3.FACE_1, 'shoot3'); | |
ig.input.bind( ig.GAMEPAD4.FACE_1, 'shoot4'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# saved to ~/bin/batcharge.py and from | |
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity | |
#!/usr/bin/env python | |
# coding=UTF-8 | |
import math, subprocess | |
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE) | |
output = p.communicate()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" /> |
NewerOlder