Skip to content

Instantly share code, notes, and snippets.

View thebeardphantom's full-sized avatar

Mika Notarnicola thebeardphantom

View GitHub Profile
@thebeardphantom
thebeardphantom / BlenderImportFixesProcessor.cs
Last active November 25, 2025 11:53
An AssetPostprocessor that fixes the import rotations for .blend files, and FBX files exported by blender using default settings. If using this processor use the DEFAULT export settings in Blender!
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.Pool;
public class BlenderImportFixesProcessor : AssetPostprocessor
{
private const float Epsilon = 3E-07f;
@thebeardphantom
thebeardphantom / AssemblyDefinitionCleanupPostProcessor.cs
Last active March 31, 2024 23:19
Sorts imports of an AssemblyDefinition asset in Unity.
#define POSTPROCESSOR_ENABLED
using Newtonsoft.Json.Linq;
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditorInternal;
using Debug = UnityEngine.Debug;
@thebeardphantom
thebeardphantom / PoissonJob.cs
Created January 29, 2024 09:03
A port of Fast Poisson Disk Sampling for Unity to the Jobs System (https://gist.github.com/a3geek/8532817159b77c727040cf67c92af322)
using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
using Random = Unity.Mathematics.Random;
/*
* A port of Fast Poisson Disk Sampling for Unity to the Jobs System.
@thebeardphantom
thebeardphantom / CsvDataGenerator.CsvFile.cs
Last active January 27, 2024 11:06
An example of generating ScriptableObjects and populating their serialized properties via CSV files.
using System;
using System.Linq;
using UnityEngine;
public static partial class CsvDataGenerator
{
#region Types
public class CsvFile
{
@thebeardphantom
thebeardphantom / GSheetImporter.cs
Last active October 29, 2023 10:35
Simple .gsheet to TextAsset ScriptedImporter for Unity, with code from https://gist.github.com/jasonleehodges/359eb2af0d1caec0153bb7450c165ffd
[ScriptedImporter(1, "gsheet")]
public class GSheetImporter : ScriptedImporter
{
#region Types
private class WebClientEx : WebClient
{
#region Fields
private readonly CookieContainer _container;
@thebeardphantom
thebeardphantom / BlenderSupportFunctions.cs
Last active September 4, 2023 16:49
Improvements to Unity <-> Blender <-> FBX <-> Blendfile workflows. See readme.txt.
using System;
using System.Diagnostics;
using System.IO;
using Unity.Logging;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
using Debug = UnityEngine.Debug;
public class BlenderSupportFunctions : AssetPostprocessor
@thebeardphantom
thebeardphantom / AttenuationCurve.cs
Last active June 17, 2022 23:42
AttenuationCurve
using System;
using Unity.Mathematics;
using UnityEngine;
[Serializable]
public struct AttenuationCurve
{
#region Properties
[field: SerializeField]
using System;
using System.Linq;
using UnityEditor;
using UnityEditor.ShortcutManagement;
using UnityEngine;
[InitializeOnLoad]
public class PlayModeShortcutManagerProfileUtility
{
#region Types
@thebeardphantom
thebeardphantom / TaskData.cs
Last active February 16, 2022 10:32
Simple, efficient task scheduler for Unity using SortedSet<T>.
using UnityEngine;
public readonly struct TaskData
{
#region Fields
public readonly double ExecTime;
public readonly double DelayTime;
using Cysharp.Threading.Tasks;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using UnityEditor;
using UnityEditor.Recorder;
using UnityEditor.Recorder.Input;
using UnityEngine;
[DefaultExecutionOrder(-50)]
public class IconRecorder : MonoBehaviour