This file contains hidden or 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 ## | |
*.cs diff=csharp text | |
*.cginc text | |
*.shader text | |
*.mat merge=unityyamlmerge eol=lf | |
*.anim merge=unityyamlmerge eol=lf | |
*.unity merge=unityyamlmerge eol=lf | |
*.prefab merge=unityyamlmerge eol=lf |
This file contains hidden or 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 hidden or 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.CodeDom; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Reflection; | |
using UnityEngine; | |
using UnityEditor; | |
using Random = UnityEngine.Random; |
This file contains hidden or 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
public static class TagManager | |
{ | |
private const string TAG_MANAGER_PATH = "ProjectSettings/TagManager.asset"; | |
public static bool ContainsTag(string tag) | |
{ | |
SerializedProperty prop; | |
if (GetAssetDatabase(out prop)) | |
{ | |
for (int i = 0; i < prop.arraySize; i++) |
This file contains hidden or 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 UnityEngine.VR; // you always need this to use special VR functions | |
public class VRUtility : MonoBehaviour { | |
// Use this for initialization | |
public void Start () { | |
// set render quality to 50%, sacrificing visual quality for higher FPS |
This file contains hidden or 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 UnityEngine.VR; // we need this line here for InputTracking and VRSettings functions | |
// USAGE: put this on a thing you want the player to look at! | |
// this code will enable that thing to know if it is being looked at! | |
[RequireComponent (typeof(Collider)) ] // this thing needs a collider if we should look at it | |
public class RaycastTargetTrigger : MonoBehaviour { |
This file contains hidden or 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
These 3 pieces of codes, are all returning wether a list/dictionary has elements or not. | |
Normal: | |
int count = 0; | |
foreach (var ep in IPEndPoints) | |
{ | |
if (ep.Value == null) | |
{ | |
count++; | |
} |
This file contains hidden or 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; | |
public static class ParticleExtensions | |
{ | |
/// Add Extension to the native ParticleSystem class. | |
/// eg: myParticleSystem.Scale(2); | |
public static void Scale(this ParticleSystem particles, float scale, bool includeChildren = true) { | |
ParticleScaler.Scale(particles, scale, includeChildren); | |
} |
This file contains hidden or 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 hidden or 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
#!/bin/bash | |
# Uses Gource (http://gource.io) to generate a lossless PPM and a high quality MP4 visualizing the history of a Git repo. | |
# By Jayden Seric: https://gist.github.com/jaydenseric/df3263eb3c33856c11ce | |
# Install Gource and FFmpeg with Homebrew: | |
# brew install gource | |
# brew install ffmpeg |