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
<EditorStyle name="MonoDevelop 2.4" _description="Old default MonoDevelop theme"> | |
<Style name="text" color="#000000" bgColor="#FFFFFF" /> | |
<Style name="text.background.readonly" color="#FAFAFA" /> | |
<Style name="linenumber" color="#888A85" bgColor="#FDFDFF" /> | |
<Style name="linenumber.highlight" color="#555753" /> | |
<Style name="iconbar" color="#FDFDFF" /> | |
<Style name="iconbar.separator" color="#BABDB6" /> | |
<Style name="fold" color="#BABDB6" bgColor="#FDFDFF" /> | |
<Style name="fold.highlight" color="#555753" /> | |
<Style name="fold.togglemarker" color="#000000" /> |
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 class ShuffleBag<T> : ICollection<T>, IList<T> | |
{ | |
private List<T> data = new List<T> (); | |
private int cursor = 0; | |
private T last; | |
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
// Poly Separate | |
// Copyright (C) 2012 Basenji Games | |
// Licensed under the MIT license | |
string $selection[] = `ls -sl`; | |
sepMat($selection[0]); | |
global proc sepMat(string $object){ | |
string $shadingGroups[] = getSGsFromShape($object); | |
string $ParentName = ($object + "_lightMap_Group"); |
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; | |
public class MonoBehaviourSingleton<T> : MonoBehaviour | |
where T : Component | |
{ | |
private static T _instance; | |
public static T Instance { | |
get { | |
if (_instance == null) { |
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; | |
using UnityEditor; | |
public class CreateQuadMesh : Editor { | |
[MenuItem("Assets/Create/Quad Mesh", false, 10000)] | |
public static void Create () | |
{ | |
Mesh mesh = BuildQuad (1, 1); |
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; | |
using System.IO; | |
public class FileUtility { | |
/// <summary> | |
/// Determine whether a given path is a directory. | |
/// </summary> |
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 (int i = branches.Length - 1; i > 0; --i) { | |
int next = Random.Range (0, i + 1); | |
Transform temp = shuffled [i]; | |
shuffled [i] = shuffled [next]; | |
shuffled [next] = temp; | |
} |
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; | |
/// <summary> | |
/// Utility class for working with planes relative to a camera. | |
/// </summary> | |
public static class CameraPlane | |
{ | |
/// <summary> | |
/// Returns world space position at a given viewport coordinate for a given depth. |
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
// Defines the required parameters and return value type for a StateMachine state. | |
// Returns a bool representing whether or not the state has finished running. | |
public delegate bool StateDelegate (); | |
// To use, create an instance of StateMachine inside of a MonoBehaviour, load it up with | |
// references to state methods with ChangeState(), then call its Execute() method during the | |
// MonoBehaviour's Update cycle. An example MonoBehaviour is included at the bottom of this file. | |
public class StateMachine | |
{ | |
// Keep track of the currently running state |
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; | |
public class CreateAssetFromScript : Editor { | |
[MenuItem("Assets/Create Asset From Manager Script", false, 10000)] | |
public static void CreateManager () | |
{ | |
ScriptableObject asset = ScriptableObject.CreateInstance (Selection.activeObject.name); |
OlderNewer