Skip to content

Instantly share code, notes, and snippets.

View kurtdekker's full-sized avatar

Kurt Dekker kurtdekker

View GitHub Profile
@kurtdekker
kurtdekker / SceneToText.cs
Created August 18, 2025 23:51
Scene To Text dumper - just for easy note-taking and idea transfer
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.SceneManagement;
using UnityEditor.SceneManagement;
// @kurtdekker
//
// A handy way to emit the contents of a scene or prefab as text.
@kurtdekker
kurtdekker / JumpToDeclarationContextMenu.cs
Created August 18, 2025 23:49
Unity3D: right-click to jump to code containing inspector variable
// found here, tested in Unity2018:
//
// https://discussions.unity.com/t/nice-but-still-no-feature-that-help/1675548
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
using System;
using System.Reflection;
@kurtdekker
kurtdekker / Old2New.cs
Last active February 25, 2025 14:48
Unity3D: rapidly swap old Input system for New Input System
//
// @kurtdekker
//
// How to start using the new input system in place of the old one.
//
// If you've been using Input.* for everything, here is how to start
// using the new input system without a lot of extra fussing around.
//
using UnityEngine;
@kurtdekker
kurtdekker / BREAKOUT.cs
Created January 31, 2025 20:37
Emergency infinite loop breakout code
using UnityEngine;
// @kurtdekker - dead-simple infinite loop finder
// TODO: call BREAKOUT.Check(); from within every suspect loop.
// TODO: optionally supply a custom max callcount
public class BREAKOUT : MonoBehaviour
{
static BREAKOUT _instance;
@kurtdekker
kurtdekker / SceneViewUIObjectPickerContextWindow.cs
Created December 13, 2024 17:26 — forked from yasirkula/SceneViewUIObjectPickerContextWindow.cs
Select the UI object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2021_2_OR_NEWER
using PrefabStage = UnityEditor.SceneManagement.PrefabStage;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
@kurtdekker
kurtdekker / RacingPreciseFinishLine.cs
Created November 30, 2024 19:36
demonstration of precise race finish line timing
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker - precise timing on two cars passing the finish line at the same instant
//
// from forum post:
//
// https://discussions.unity.com/t/how-do-you-measure-milliseconds-at-runtime/1562308
//
@kurtdekker
kurtdekker / ShepardTones.cs
Created November 25, 2024 05:19
Shepard Tones for Unity3D
namespace Zooming
{
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker - Shepard Tones for Unity3D.
//
// https://en.wikipedia.org/wiki/Shepard_tone
//
@kurtdekker
kurtdekker / PostProcessingSceneUtilities.cs
Created October 30, 2024 17:57
PostProcessingScene work - a way to temporarily modify scenes at build time
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections.Generic;
// @kurtdekker
//
// Makes temporary changes to scenes when building.
//
// Obviously this must live in an Editor/ folder.
@kurtdekker
kurtdekker / StreamingAssetsPath.cs
Created October 7, 2024 19:09
Unity3D streaming assets path for several platforms
using UnityEngine;
// @kurtdekker
public static class StreamingAssetsPath
{
public static string StreamingAssetPathForWWW()
{
#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
return "file://" + Application.dataPath + "/StreamingAssets/";
@kurtdekker
kurtdekker / FilterUtilities.cs
Created August 12, 2024 01:37
Filter utilities: a deadband expander
public static partial class FilterUtilities
{
// @kurtdekker
//
// Part of Jetpack Kurt Space Flight available for iOS/Android
//
// Evalutes a normalized analog input signal (such as an analog
// axis) and filters it:
//