Skip to content

Instantly share code, notes, and snippets.

@a3geek
a3geek / PoissonDiskSampling.cs
Last active February 28, 2024 07:37
Fast Poisson Disk Sampling for Unity.
using System.Collections.Generic;
using UnityEngine;
namespace Gists
{
// The algorithm is from the "Fast Poisson Disk Sampling in Arbitrary Dimensions" paper by Robert Bridson.
// https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf
public static class FastPoissonDiskSampling
{
@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;
}
@bkaradzic
bkaradzic / why_i_think_immediate_mode_gui_is_way_to_go_for_gamedev_tools.md
Last active April 5, 2024 05:40
Why I think Immediate Mode GUI is way to go for GameDev tools

Why I think Immediate Mode GUI is way to go for GameDev tools

Prerequisites

Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!

If you know what IMGUI is, for context read following presentations and blog posts:

  • Insomniac’s Web Tools Postmortem
@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
{
@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()
{
// 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()
@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
@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
//
// 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)
//
@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;