Skip to content

Instantly share code, notes, and snippets.

@AlexandreDeRiemaecker
AlexandreDeRiemaecker / EnforcePresetPostProcessor.cs
Created February 5, 2021 14:42
Apply Unity Preset file found in folder of Spritesheet texture. Additionally slices the sheet when the texture name starts with "char_" (for a Manaseed character spritesheet). Based on https://docs.unity3d.com/Manual/DefaultPresetsByFolder.html
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.Experimental;
using UnityEditor.Presets;
using UnityEngine;
namespace PresetsPerFolder
@favoyang
favoyang / BuildAddressables.cs
Last active August 14, 2023 06:29
Build addressable bundles when clicking the build button
/// <summary>
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
/// For custom build script, call PreExport method yourself.
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
///
/// License: The MIT License https://opensource.org/licenses/MIT
/// </summary>
using UnityEditor;
using UnityEditor.AddressableAssets;
@daemon3000
daemon3000 / TagsAndLayersTool.cs
Last active August 2, 2023 03:59
A tool for Unity that generates type safe tags and layers
#region [Copyright (c) 2014-2017 Cristian Alexandru Geambasu]
// Distributed under the terms of an MIT-style license:
//
// The MIT License
//
// Copyright (c) 2014-2017 Cristian Alexandru Geambasu(daemon3000@hotmail.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,
@speps
speps / DebugDraw.cs
Created September 11, 2012 19:48
DebugDraw - Unity3D based debug drawing for programmers
// Remi Gillig - http://speps.fr - 2012 - Public domain
using System;
using System.Collections.Generic;
using UnityEngine;
public class DebugDraw
{
static Material material = new Material(
@"Shader ""Custom/DebugDraw"" {