Skip to content

Instantly share code, notes, and snippets.

@yagero
yagero / EventSystemManaged.cs
Created November 7, 2017 10:14
EventSystemManaged
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class EventSystemManaged : EventSystem
{
static Stack<EventSystem> ms_PrevEventSystem = new Stack<EventSystem>();
static bool ms_Forced = false;
protected override void OnEnable()
@partlyhuman
partlyhuman / unity-find-usages.sh
Created January 9, 2018 02:28
Find all references to Unity object
#!/bin/bash
# usage: send path of an asset in. the script will find the GUID from the associated meta file, and look for usages of this GUID anywhere.
# of course only works with text mode (YAML) serialization
GUID=$(grep -Po '(?<=guid: )\w+' $1.meta)
echo "Object has GUID $GUID"
echo "Searching for instances..."
find . \( -name "*.asset" -o -name "*.prefab" -o -name "*.unity" \) -exec grep -l $GUID {} \;