Skip to content

Instantly share code, notes, and snippets.

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

Mike Wuetherick gekidoslair

💭
Surfin the Chaos
View GitHub Profile
@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
@gekidoslair
gekidoslair / ResourceChecker.cs
Last active January 30, 2020 14:55
Gives you a list of resources (objects, materials, textures) used in a scene, super helpful for optimizing scenes (mobile etc) - updated for 2019.x
// Resource Checker
// (c) 2012 Simon Oliver / HandCircus / hello@handcircus.com
// (c) 2015 Brice Clocher / Mangatome / hello@mangatome.net
// Public domain, do with whatever you like, commercial or not
// This comes with no warranty, use at your own risk!
// https://github.com/handcircus/Unity-Resource-Checker
using System;
using System.Linq;
using UnityEngine;
@gekidoslair
gekidoslair / FindMissingScriptsRecursivelyAndRemove.cs
Last active September 21, 2017 02:55
Cleans up missing references to components in a Unity scene. Uses some c# 4 magic, switch to experimental c# 4.6 runtime to use
using UnityEditor;
using UnityEngine;
namespace PixelWizards.Shared.Utilities
{
/// from this pastebin: https://pastebin.com/DLuE2Ze9
public class FindMissingScriptsRecursivelyAndRemove : EditorWindow
{
private static int _goCount;
private static int _componentsCount;
@gekidoslair
gekidoslair / Customizer.cs
Last active September 8, 2017 05:57
Simple Customization Script, has a data model that could be used to save / store the customizations (for a save game or persistent state) as well as a simple randomization system for picking random elements at startup. The 'mandatory' flag is there because it does a pre-check to see if an element from this particular category should even be used…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace PixelWizards.GameSystem.Controllers
{
public class CharacterCustomization
{
public int curBackpack = 0;
public int curBag = 0;