Skip to content

Instantly share code, notes, and snippets.

View bsimser's full-sized avatar
💭
Waiting for the zombie apocalypse to start

Bil Simser bsimser

💭
Waiting for the zombie apocalypse to start
View GitHub Profile
@bsimser
bsimser / TilemapExporter.cs
Created March 26, 2026 14:12
Unity Tilemap to PNG Exporter
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.Tilemaps;
public class TilemapExporter : EditorWindow
{
private string outputPath = "";
@bsimser
bsimser / ActivateOnStart.cs
Created March 23, 2026 16:45
Handle activating/deactivating objects in a scene on startup
using UnityEngine;
/// <summary>
/// Add this component to an empty game object and assign other game objects
/// to it for activation/deactivation on start.
///
/// This is useful for ensuring certain game objects are active/inactive before
/// other components' Start() methods are called, as this component has a default
/// execution order of -1000.
/// </summary>
@bsimser
bsimser / EnemySoundListener.cs
Created February 20, 2026 14:25
For anyone who would like the enemy to be able to hear you, place the script on your enemy.
///////////////////////////////////////////////////////////////////////////////
//
// This code is licensed under MIT license.
//
// Copyright © 2026 Bil Simser, https://www.simstools.com
//
// 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
@bsimser
bsimser / TreeObstacleBaker.cs
Last active February 20, 2026 14:18
A way to bake your unity terrain trees into the nav mesh
///////////////////////////////////////////////////////////////////////////////
//
// This code is licensed under MIT license.
//
// Copyright © 2026 Bil Simser, https://www.simstools.com
//
// 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
///////////////////////////////////////////////////////////////////////////////
//
// This code is licensed under MIT license.
//
// Copyright © 2026 Bil Simser, https://www.simstools.com
//
// 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
@bsimser
bsimser / MenuItemOrder.cs
Created January 18, 2025 15:13
The missing random tile from Unity's tilemap system that was removed in the most recent builds of the package
/*
This file contains the additional ETilesMenuOrder enum value for the RandomTile
Should be saved as
/Editor/Menu/MenuOrder.cs
*/
using UnityEngine;
using UnityEngine.Tilemaps;
namespace UnityEditor.Tilemaps
@bsimser
bsimser / StringExtensions.cs
Created October 1, 2024 17:08
Improved readability to string.IsNullOrEmpty
public static class StringExtensions
{
public static bool HasValue(this string value)
{
return !string.IsNullOrEmpty(value);
}
}
@bsimser
bsimser / Footsteps.cs
Created December 11, 2022 15:33 — forked from joonjoonjoon/Footsteps.cs
Multi-surface footsteps audio script for Unity's Viking Village
/* ======================================================================================== */
/* FMOD Studio - Unity Integration Demo. */
/* Firelight Technologies Pty, Ltd. 2012-2016. */
/* Liam de Koster-Kjaer */
/* */
/* Use this script in conjunction with the Viking Village scene tutorial and Unity 5.4. */
/* http://www.fmod.org/training/ */
/* */
/* 1. Import Viking Village asset package */
/* 2. Import FMOD Studio Unity Integration package */
@bsimser
bsimser / Footsteps.cs
Created December 11, 2022 15:32 — forked from WickedJumper/Footsteps.cs
Multi-surface footsteps audio script for Unity's Viking Village
/* ======================================================================================== */
/* FMOD Studio - Unity Integration Demo. */
/* Firelight Technologies Pty, Ltd. 2012-2016. */
/* Liam de Koster-Kjaer */
/* */
/* Use this script in conjunction with the Viking Village scene tutorial and Unity 5.4. */
/* http://www.fmod.org/training/ */
/* */
/* 1. Import Viking Village asset package */
/* 2. Import FMOD Studio Unity Integration package */
@bsimser
bsimser / HierarchySectionHeader.cs
Last active November 15, 2021 13:43
Re-styles a gameObject name in the Unity Hierarchy window to be black with white lettering and all caps to stand out
///////////////////////////////////////////////////////////////////////////////
//
// This code is licensed under MIT license.
//
// Copyright © 2014 Bil Simser, https://weblogs.aspnet/bsimser <[email protected]>
//
// 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