Skip to content

Instantly share code, notes, and snippets.

@markcastle
markcastle / InactiveCodeDetector.cs
Last active May 15, 2023 16:45 — forked from Happsson/InactiveCodeDetector.cs
A script that lets you find unused scripts in your unity projects.
/*
Original tool from Hannes Paulsson
From: https://gist.github.com/Happsson/af02d7a644db6b44bc834c8699bf3495
Updated 2023/05/15 by Mark Castle (and ChatGPT :P) to add excluded paths and to also
give the option of opening files in the current editor, plus some minor tweaks
to keep re-sharper happy.
https://gist.github.com/markcastle/be019a471b44016d73c11f308feb5249
@markcastle
markcastle / HighResolutionTimer.cs
Created February 23, 2020 14:52 — forked from DraTeots/HighResolutionTimer.cs
HighResolutionTimer for .NET
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
namespace HighResolutionTimer
{
@markcastle
markcastle / MultiSceneSetup.cs
Created October 23, 2019 14:16 — forked from svermeulen/MultiSceneSetup.cs
Simple editor script to save and load multi-scene setups within Unity3D
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEditor.SceneManagement;
using UnityEditor;
using System.Collections;
using System.Linq;
public class MultiSceneSetup : ScriptableObject
{
@markcastle
markcastle / ExtensionExample.cs
Created September 26, 2019 09:50 — forked from AdamRamberg/ExtensionExample.cs
Delegates and Extensions in Unity - ExtensionExample.cs
// Defines an add method that is chainable (returns itself)
public static List<T> ChainableAdd<T>(this List<T> list, T item)
{
list.Add(item);
return list;
}
// Usage
List<int> numbers = new List<int>();
numbers.ChainableAdd(1).ChainableAdd(2).ChainableAdd(3); // numbers will now contain [1, 2, 3]