Skip to content

Instantly share code, notes, and snippets.

View gekidoslair's full-sized avatar
💭
Surfing the Chaos

Mike Wuetherick gekidoslair

💭
Surfing the Chaos
View GitHub Profile
@gekidoslair
gekidoslair / ApplySelectedPrefabs.cs
Created July 13, 2018 17:56
Bulk apply / revert selected prefabs editor script
namespace PixelWizards.EditorTools
{
using UnityEditor;
using UnityEngine;
/// <summary>
/// Apply or revert multiple prefabs at the same time
/// Source: https://forum.unity3d.com/threads/little-script-apply-and-revert-several-prefab-at-once.295311/
/// </summary>
public class ApplySelectedPrefabs
@gekidoslair
gekidoslair / ConsoleCallStackHelper.cs
Created May 28, 2018 19:09 — forked from sabresaurus/ConsoleCallStackHelper.cs
Jump to file/line in the Unity console window callstack via this helper window
// MIT License
//
// Copyright (c) 2018 Sabresaurus
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@gekidoslair
gekidoslair / GenericTrigger.cs
Created April 30, 2018 16:59
Activate a Unity Timeline from a trigger
using UnityEngine;
using UnityEngine.Playables;
public class GenericTrigger : MonoBehaviour
{
public PlayableDirector timeline;
// Use this for initialization
void Start()
{
@gekidoslair
gekidoslair / UnityGuidRegenerator.cs
Created April 11, 2018 03:32
Regenerates Unity GUIDs - useful if you have multiple packages that are stomping on each other, among other things.
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
[MenuItem("Pixel Wizards/Tools/Regenerate asset GUIDs")]
public static void RegenerateGuids() {
if (EditorUtility.DisplayDialog("GUIDs regeneration",
@gekidoslair
gekidoslair / DrawBones.cs
Created February 7, 2018 00:40
Debug draw bones in the editor
using UnityEngine;
namespace PixelWizards.Shared.Utilities
{
/// <summary>
/// Debug draw bones in the editor
/// </summary>
public class ShowBones : MonoBehaviour
{
private Transform rootNode;
@gekidoslair
gekidoslair / RootMotionNavMesh.cs
Last active May 10, 2022 10:07
Root Motion based Navmesh characters in Unity
using UnityEngine;
using UnityEngine.AI;
namespace PixelWizards.GameSystem.Controllers
{
/// <summary>
/// All this does is implement the OnAnimatorMove() for our Units
/// </summary>
public class RootMotionNavMesh : MonoBehaviour
{
@gekidoslair
gekidoslair / TriggerEditor.cs
Created November 25, 2017 21:03 — forked from bzgeb/TriggerEditor.cs
Template for Custom Inspector Script in Unity3d
using UnityEngine;
using UnityEditor;
[CustomEditor (typeof(Trigger))]
[CanEditMultipleObjects()]
public class TriggerEditor : Editor
{
private SerializedObject obj;
private SerializedProperty radius;
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@gekidoslair
gekidoslair / CustomEditorBase.cs
Created September 26, 2017 23:29
want proper re-orderable lists by default for all inspectors in #unity3d? drop this into an editor folder and it magically works ;P
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@gekidoslair
gekidoslair / QuickToggle.cs
Created September 21, 2017 02:08
Adds 'visibliity' and 'lock' icons to the Unity scene view, see https://chemikhazi.itch.io/unity-quick-toggle
/*
Copyright 2017, Jeiel Aranal
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial