Skip to content

Instantly share code, notes, and snippets.

View hassan404's full-sized avatar

Hassan Ali hassan404

View GitHub Profile
@jstine35
jstine35 / SwapEditorShortcutsOnPlayerFocus.cs
Last active December 3, 2022 08:15
Resolves Editor Keyboard Behavior in Unity Player, so your game can handle CTRL and hotkeys without corrupting your scene
// Summary
// Disables Editor Keyboard Behavior when Unity Player has focus, so your game can handle CTRL and
// without corrupting your scene.
//
// Usage
// * Download or copy/paste and attach this component to a scene management object in your scene.
// * Create a new shortcut profile using Edit->Shortcuts (tedious, you need to pretty much click every
// button and remove every keystroke, one by one).
//
// Remarks
@vildninja
vildninja / RemoveMissingScriptsRecursively.cs
Created March 25, 2019 10:06
Remove missing MonoBehaviour script components in Unity 2019.1 including visiting prefafab assets.
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
public static class FindMissingScriptsRecursively
{
[MenuItem("Auto/Remove Missing Scripts Recursively Visit Prefabs")]
private static void FindAndRemoveMissingInSelected()
{
// EditorUtility.CollectDeepHierarchy does not include inactive children