Skip to content

Instantly share code, notes, and snippets.

View bo11ox's full-sized avatar
🏴󠁧󠁢󠁳󠁣󠁴󠁿
:rage4:

Rainer Strobo bo11ox

🏴󠁧󠁢󠁳󠁣󠁴󠁿
:rage4:
  • FFM/Germany
View GitHub Profile
@unitycoder
unitycoder / CustomImportProcessor.cs
Created February 27, 2023 07:02
Read FBX Custom Properties (Unity Editor Script AssetPostprocessor)
// https://forum.unity.com/threads/how-to-import-user-defined-attributes-from-fbx-files.409877/
using UnityEngine;
using UnityEditor;
using System.IO;
class CustomImportProcessor : AssetPostprocessor {
void OnPostprocessGameObjectWithUserProperties(GameObject go, string[] names, System.Object[] values) {
ModelImporter importer = (ModelImporter)assetImporter;
var asset_name = Path.GetFileName(importer.assetPath);
Debug.LogFormat("OnPostprocessGameObjectWithUserProperties(go = {0}) asset = {1}", go.name, asset_name);
@adammyhre
adammyhre / InspectorLock.cs
Last active May 1, 2026 03:46
Lock Inspector Icon and Transform Constrain Proportion Icon in Unity
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Toggles the Inspector lock state and the Constrain Proportions lock state.
/// </summary>
public static class LockInspector {
static readonly MethodInfo flipLocked;
static readonly PropertyInfo constrainProportions;
using UnityEngine;
using System.IO;
using System;
public static class RenderTextureExtensions
{
private static DefaultDictionary<RenderTexture, Texture2D> _cachedTextures = new DefaultDictionary<RenderTexture, Texture2D>();
@SolarianZ
SolarianZ / BoneVibrator.cs
Last active December 6, 2025 19:11
{"category": "Unity/Runtime/Utility/Animation", "keywords": "Animation, Hit feedback, Bone Vibrate, Simple Harmonic Motion, SHM, Second Order System"} A simple single-skeleton vibrator for simple hit feedback.
// NOTE: The 'SimpleHarmonicMotion.cs' is here: https://gist.github.com/SolarianZ/78f9b22d9663d77b6e6c1b0c60cc6322
// You need to change `System.Numerics.Vector3` to `UnityEngine.Vector3` in SimpleHarmonicMotion.cs
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
[DisallowMultipleComponent]
public class BoneVibrator : MonoBehaviour
@adammyhre
adammyhre / ProjectSetup.cs
Last active April 7, 2026 09:08
Automated Unity Project Setup Script
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
using static System.Environment;
@adammyhre
adammyhre / SessionManager.cs
Last active April 7, 2026 09:07
QuickStart SessionManager for 2025 Multiplayer Services
using System;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using Unity.Services.Authentication;
using Unity.Services.Core;
using Unity.Services.Multiplayer;
using UnityEngine;
using UnityUtils;
public class SessionManager : Singleton<SessionManager> {
@adammyhre
adammyhre / HeatmapCompute.compute
Last active April 7, 2026 09:07
Compute Shader + Render Feature Heatmap
#pragma kernel CSMain
RWTexture2D<float> heatmapTexture;
float2 texSize;
StructuredBuffer<float2> enemyPositions;
int enemyCount;
[numthreads(8, 8, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)