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
// NoiseCrime Gist | |
// 2014.06.21 | |
// Unity Version: 3.5.7+ | |
// This script demonstrates how you can use MenuItem to append commands to a script component context menu. | |
// The new commands will be available by right-clicking on a component header or clicking the little cog icon. | |
// Docs: http://docs.unity3d.com/ScriptReference/MenuItem.html | |
// Note: You must use the current class name/type in both the MenuItem and where the context is used in the code. |
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
// NoiseCrime Gist | |
// 2014.06.21 | |
// Unity Version: 3.5.7+ | |
// This script provides access to a projects scene names in the Inspector. | |
// It uses MenuItem to assing commands to the component context menu. | |
// Docs: http://docs.unity3d.com/ScriptReference/MenuItem.html |
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
// NoiseCrime Gist | |
// 2014.06.22 | |
// Unity Version: 3.5.7+ | |
// Class to examine all Mac Addresses on Machine, selects the fastest to use as a validation ID. | |
// Can specify multiple valid Mac Addresses. | |
// Can Quit Application if valid Mac not found. | |
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; | |
public class EditorWindowExample : EditorWindow | |
{ | |
List<Node> nodes = new List<Node> (); |
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
// NoiseCrime Gist | |
// 2014.07.16 | |
// Unity Version: 3.5.7+ | |
// Simple editor script to duplicate animation clips found in the selected model/animation asset file. | |
// Duplicates unlike original animation clips may be edited. | |
using UnityEngine; | |
using UnityEditor; |
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
// ShuffleDeck | |
// Simple generic (mostly) deck shuffling utility. | |
using System.Collections.Generic; | |
using System; | |
public class ShuffleDeck | |
{ | |
public static Stack<T> CreateShuffledDeck<T>(IEnumerable<T> values, int numDecks) |
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
// Place this file into a directory called Editor inside of your Assets directory. | |
// Models imported after you do that will have: | |
// - Smoothing Angle seto to 180. | |
// - Normals set to Import. | |
// - Tangents set to Calculate. | |
// - Tangents set to Split Tangents. | |
// Any models that are already imported can have this applied by selecting them in | |
// the Project panel, right clicking and selecting "Reimport" from the pop-op menu. |
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
static public IEnumerator Wait( float duration ) | |
{ | |
while( duration > 0 ) | |
{ | |
duration -= Time.deltaTime; | |
yield return null; // 'yield return 0;' generates garbage from C# boxing, so always use 'yield return null;' instead | |
} | |
} |
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 UnityEditor; | |
using UnityEngine; | |
//Unity 4.1.5 | |
public class UnityTextures : EditorWindow | |
{ |
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
// Based on | |
// http://answers.unity3d.com/questions/956123/add-and-select-game-view-resolution.html | |
using System; | |
using UnityEditor; | |
using UnityEngine; | |
namespace NoiseCrime.Editor.Tools | |
{ | |
public static class GameViewAddResolutions |
OlderNewer