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; | |
/// <summary> | |
/// Indicates that an inspector field must have its value assigned during authoring. | |
/// </summary> | |
[AttributeUsage(AttributeTargets.Field)] | |
public class RequiredFieldAttribute : PropertyAttribute | |
{ | |
} |
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
/** | |
* PennerEasing | |
* Calculates a float value between two target values using | |
* Robert Penner's easing equations for interpolation over a specified duration. | |
* | |
* @author Darren David [email protected] | |
* @version 1.0 | |
* | |
* Credit/Thanks: | |
* Robert Penner - The easing equations we all know and love |
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
// Load story file | |
string storyJson = File.ReadAllText ("Stories/musgraveritual.json"); | |
StoryModel model = StoryModel.Create (storyJson); | |
// Find the saved stitch and fast forward the story's initial stitch: | |
string restoredStitchName = "holmesResumedHis"; // load this from disk | |
foreach (var stitch in model.Story.Stitches) { | |
if (stitch.Name == restoredStitchName) { | |
// Fast forward the story to this stitch | |
model.Story.InitialStitch = stitch; |
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
# OS X Tweaks | |
# =========== | |
# General | |
# ------- | |
# Disable smart quotes and dashes | |
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false | |
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false |
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
for name in *.ogg; do ffmpeg -i "$name" -ab 128k -map_metadata 0:s:0 "${name/.ogg/.mp3}"; done; |
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; | |
using System.Collections.Generic; | |
public static class IEnumeratorExtensions | |
{ | |
/// <summary> | |
/// Execute an entire Unity Coroutine in one frame. | |
/// This is useful for testing coroutines with NUnit. | |
/// |
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
/// <summary> | |
/// Yield on a DoForSeconds object within a coroutine and the supplied callback method | |
/// will be invoked during each Unity Update cycle. | |
/// | |
/// Example: yield return DoForSeconds (1, (elapsed, duration) => { Debug.Log (elapsed/duration); }); | |
/// </summary> | |
public class DoForSeconds : CustomYieldInstruction | |
{ | |
public delegate void UpdateCallback (float elapsed, float duration); | |
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
# unity | |
*.unitypackage filter=lfs diff=lfs merge=lfs -text | |
*.cubemap filter=lfs diff=lfs merge=lfs -text | |
*.spm filter=lfs diff=lfs merge=lfs -text | |
# models | |
*.mb filter=lfs diff=lfs merge=lfs -text | |
*.MB filter=lfs diff=lfs merge=lfs -text |
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; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Debugging tools | |
/// </summary> | |
public static class Instruments | |
{ | |
static string stopwatchName; |
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; | |
using System.Linq; | |
public class FindReferences : EditorWindow, ISerializationCallbackReceiver | |
{ | |
List<string> displayedRefs = new List<string>(); |