Skip to content

Instantly share code, notes, and snippets.

@frideal
frideal / PlayVideo.cs
Last active June 22, 2016 15:18
Unity3d Play video on IOS and android
using UnityEngine;
using System.Collections;
using System.IO;
public class PlayVideo : MonoBehaviour
{
private string streamingPath = string.Empty;
private string urlStreamPath = string.Empty;
private string streamingFileMp4Name = "test001.mp4";
@AngryAnt
AngryAnt / MoveComponentContext.cs
Last active July 5, 2017 05:44
Adds "Move to Top" and "Move to Bottom" items to the inspector context menu of components.
using UnityEngine;
using UnityEditor;
public class MoveComponentContext
{
enum Destination
{
Top,
Bottom
@AngryAnt
AngryAnt / CustomAnimationEditor.cs
Created February 22, 2012 11:53
An old example of how to easily preview animations on objects in-scene.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
[CustomEditor (typeof (Animation))]
public class CustomAnimationEditor : Editor
{
AnimationClip m_SampleClip;
float m_SampleTime = 0.0f;
@yajh
yajh / SceneSearcher.cs
Created April 14, 2014 01:53
Unity3d asset reference searcher.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
using System.Collections.Generic;
using System.Linq;
public class SceneSearcher : EditorWindow
{
@jaredjenkins
jaredjenkins / ConcurrentQueue.cs
Last active November 13, 2017 00:00
Concurrent Queue for Unity
using System;
using System.Collections.Generic;
namespace PlaynomicsPlugin
{
internal class ConcurrentQueue<T>{
private readonly object syncLock = new object();
private Queue<T> queue;
@Kink3d
Kink3d / MainLightNode.cs
Created May 8, 2018 00:13
A custom lighting node example for Shader Graph and Lightweight Render Pipeline
using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
[Title("Input", "Lighting", "Main Light")]
public class MainLightNode : AbstractMaterialNode, IGeneratesBodyCode
{
public MainLightNode()
{
@jmcguirk
jmcguirk / PerformBuild.cs
Created March 8, 2013 01:56
Unity3D Ant Build Configuration
// C# example
using UnityEditor;
using System.IO;
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
class PerformBuild
{
static string[] GetBuildScenes()
@valyard
valyard / Jobs_and_ecs.cs
Created July 10, 2017 20:20
"Slides" about C# Job System and ESC in Unity.
// ######################################################################
//
// We want you to write more efficient code
//
// ######################################################################
But, we teach the opposite...
You know, GameObjects and Components.
...
@AngryAnt
AngryAnt / EditorWindowExample.cs
Created June 15, 2012 08:30
EditorWindowExample from the Unity Asia Bootcamp 12 talk "Streamlining your Unity editor". A simple node based editor.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
public class EditorWindowExample : EditorWindow
{
List<Node> nodes = new List<Node> ();
using System;
using System.Collections.Generic;
public class GameEvent
{
}
public class EventMessenger
{