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 / BatchExtractMaterials.cs
Created April 24, 2024 20:41 — forked from yasirkula/BatchExtractMaterials.cs
Batch extract materials from 3D model assets in Unity
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
public class BatchExtractMaterials : EditorWindow
{
private enum ExtractMode { Extract = 0, Remap = 1, Ignore = 2 };
[System.Serializable]
@gekidoslair
gekidoslair / BatchExtractMaterials.cs
Created April 24, 2024 20:41 — forked from yasirkula/BatchExtractMaterials.cs
Batch extract materials from 3D model assets in Unity
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
public class BatchExtractMaterials : EditorWindow
{
private enum ExtractMode { Extract = 0, Remap = 1, Ignore = 2 };
[System.Serializable]
@gekidoslair
gekidoslair / ClickToMoveController.cs
Created April 1, 2024 17:59
A simple Click to Move player controller using a Unity Navmesh Agent.
using UnityEngine;
using UnityEngine.AI;
namespace MegaCrush.NavmeshBaker.Sample
{
/// <summary>
/// A very simple click to move player controller
/// </summary>
[RequireComponent(typeof(NavMeshAgent))]
public class ClickToMoveController : MonoBehaviour
@gekidoslair
gekidoslair / DoSomethingOnDungeonComplete.cs
Last active March 3, 2024 14:41 — forked from AG-Dan/DoSomethingOnDungeonComplete.cs
Listener script for DunGen: This script would be attached to the same object as our RuntimeDungeon component.
using UnityEngine;
using DunGen;
[RequireComponent(typeof(RuntimeDungeon))]
public class DoSomethingOnDungeonComplete : MonoBehaviour
{
private RuntimeDungeon runtimeDungeon;
private void Awake()
@gekidoslair
gekidoslair / DamageHandler.cs
Last active January 28, 2024 22:52
Blaze AI and Opsive UCC integration
using System;
using Opsive.UltimateCharacterController.Traits;
using UnityEngine;
namespace PixelWizards.GameSystem
{
/// <summary>
/// Quick tutorial for anyone that's using Opsive UCC and want to integrate it with Blaze, it's super simple:
/// 1) setup your AI with Blaze
/// 2) Add a Rigidbody
@gekidoslair
gekidoslair / BuildSystem.cs
Last active October 17, 2023 20:36
Unity Build Script
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;
public class BuildSystem
{
public enum BuildType
{
@gekidoslair
gekidoslair / BuildRadiator.cs
Created September 29, 2023 03:35 — forked from radiatoryang/BuildRadiator.cs
This is my Unity Editor build script that I use for my games, to automatically build out players and package them in ZIP files.
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Compression;
using Ionic.Zip; // this uses the Unity port of DotNetZip https://github.com/r2d2rigo/dotnetzip-for-unity
@gekidoslair
gekidoslair / UnparentGameObject.cs
Last active April 25, 2023 16:54
Simple Editor tool (place in an /Editor folder) to unparent gameobjects in the hierarchy
using UnityEditor;
namespace PixelWizards.Utilities
{
public class UnparentGameObject
{
[MenuItem("Edit/Unparent GameObject", false, 0)]
static void UnparentGO()
{
var selection = Selection.activeTransform;
@gekidoslair
gekidoslair / DestroyOnPlay.cs
Created December 18, 2022 02:18
Destroys this object if we're in play mode. Useful for debug stuff that you don't want in the actual game
using UnityEngine;
namespace PixelWizards.Utilities
{
/// <summary>
/// Destroys this object if we're in play mode.
/// Useful for debug stuff that you don't want in the actual game
/// </summary>
public class DestroyOnPlay : MonoBehaviour
{
@gekidoslair
gekidoslair / DontDestroyOnLoad.cs
Created December 18, 2022 02:10
Simple component that sets the don't destroy on load property for the game object it is attached to
using UnityEngine;
public class DontDestroyOnLoad : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
DontDestroyOnLoad(this);
}
}