Skip to content

Instantly share code, notes, and snippets.

@uzzu
uzzu / Tuple.cs
Last active December 20, 2015 14:49
Tuple implementation for unity3d (before .NET 4.0 environment)
using System;
using System.Collections;
using System.Text;
namespace System
{
/// <summary>
/// Tuple.
/// </summary>
public static class Tuple
@Sacristan
Sacristan / EditorCoroutine.cs
Last active April 13, 2017 03:20 — forked from benblo/EditorCoroutine.cs
EditorCoroutine: coroutines for Unity editor operations. Usage: EditorCoroutine.start(myIEnumerator)
//Original Author (gracefully borrowed): https://gist.github.com/benblo/10732554
//#define DEBUG_EDITORCOROUTINE
using System.Collections;
using UnityEditor;
namespace Sacristan.EditorExtensions
{
public class EditorCoroutine
{
@createdbyx
createdbyx / ContinuationManager
Created November 24, 2015 09:31
Provides a simulated multithreading manager for invoking callbacks on the main unity thread.
using System;
using System.Collections.Generic;
using System.Threading;
using UnityEditor;
/// <summary>
/// Provides a simulated multithreading manager for invoking callbacks on the main unity thread.
/// </summary>
public static class ContinuationManager
@adrian-afl
adrian-afl / MSAA shader resolving
Created March 23, 2015 16:05
MSAA shader resolving
#version 430 core
in vec2 UV;
layout(binding = 0) uniform sampler2DMS texColor;
layout(binding = 1) uniform sampler2DMS texDepth;
const int samples = 8;
float samplesInverted = 1.0 / samples;
@brendan-w
brendan-w / inspect.h
Created June 9, 2016 01:14
Command line inspector for Qt's object hierarchy
#pragma once
#include <QString>
#include <QObject>
#include <QDebug>
#ifndef SPACER
# define SPACER " "
#endif
@bhameyie
bhameyie / ModuleExtensions.cs
Last active April 16, 2020 05:05
An extension to render view as string with NancyFx
using System.IO;
using Nancy;
using Nancy.ViewEngines;
namespace Web.Modules
{
public static class ModuleExtensions
{
public static string RenderRazorViewToString(this NancyModule module, string viewName, object model)
{
// Used to generate Texture Array asset
// Menu button is available in GameObject > Create Texture Array
// See CHANGEME in the file
using UnityEngine;
using UnityEditor;
public class TextureArray : MonoBehaviour {
[MenuItem("GameObject/Create Texture Array")]
static void Create()
//
// Mono.CSharp CSharpCodeCompiler Class implementation
//
// Authors:
// Sean Kasun (seank@users.sf.net)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// Copyright (c) Novell, Inc. (http://www.novell.com)
//
@mandarinx
mandarinx / Unity_NewerThan2017_1.cs
Last active November 5, 2022 16:49
Unity3D: Detect when play mode changes to what
// For Unity versions newer than 2017.1
using UnityEditor;
[InitializeOnLoad]
public class DetectPlayModeChanges {
static DetectPlayModeChanges() {
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}
@StephenHodgson
StephenHodgson / CustomAssetInspector.cs
Last active February 27, 2023 19:54
Unity custom inspector window to render markdown language as text asset.
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(DefaultAsset))]
public class CustomAssetInspector : Editor
{
public override void OnInspectorGUI()
{