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
///
/// 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 / 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;
@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 / 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 / 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 / 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 / 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 / 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 / GameDashboard.cs
Created September 22, 2018 19:04
Simple editor window as a 'dashboard' for your Unity game
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
namespace PixelWizards.GameSystem.Utility.Editor
{
public class GameDashboard : EditorWindow
{
static int MinWidth = 150;
@gekidoslair
gekidoslair / UsingJsonDotNetInUnity.cs
Created April 15, 2019 02:15 — forked from onionmk2/UsingJsonDotNetInUnity.cs
Json.Net ( Newtonsoft.Json ) in Unity
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using UnityEngine;
public class UsingJsonDotNetInUnity : MonoBehaviour
{
private void Awake()
{