Skip to content

Instantly share code, notes, and snippets.

@LunaTheFoxgirl
LunaTheFoxgirl / 0. How to use.md
Last active March 2, 2025 11:06
Shell script to sign and notarize Unity App Bundles.

First get a Developer ID signing key from apple. You can get this through xcode if you're subscribed to their developer service.

Once you have a Developer ID in your keychain; you need to add a per-app password for notarytool. To do so go to your Apple account settings and add a new per-app-password; copy the password.

Run xcrun notarytool store-credentials --password "<INSERT PER-APP-PASSWORD HERE>" "notarytool".

After this you can add sign.sh and entitlements.plist to the outside of your Unity application, first time run chmod +x sign.sh. You can then run ./sign.sh <name of app>.app and wait.

@synasius
synasius / SerializableId.cs
Last active April 10, 2023 20:07
UI Toolkit Serializable Id
using System;
using UnityEngine;
/// <summary>
/// A generic serializable GUID.
/// </summary>
[Serializable]
public struct SerializableId<T> : IComparable<SerializableId<T>>, IEquatable<SerializableId<T>>, ISerializationCallbackReceiver
{
[SerializeField] private string _guid;
@adammyhre
adammyhre / InspectorLock.cs
Last active October 9, 2025 14:56
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;
@mattdavisgames
mattdavisgames / SdfPostProcessor.cs
Last active April 17, 2024 15:53
Unity asset post processor for converting images to Signed Distance Fields on import
/// By Matt Davis @mattdavisgames
/// Requires "SDF Toolkit Free" (or paid) by Catlike Coding (Jasper Flick)
/// Render using TextMeshPro/Distance Field SSD shader (res 512, gradient scale 52.2) (gradient scale = res * paddingRatio + 1)
///
/// Original image must include a margin of ~10% (or paddingRatio) of the image resolution, to accomodate SDF gradient.
using UnityEditor;
using UnityEngine;
using CatlikeCoding.SDFToolkit;
@karljj1
karljj1 / DefaultTmpFont.cs
Last active December 31, 2023 17:48
Localize the default TextMeshPro font.
using System.Reflection;
using TMPro;
using UnityEngine;
using UnityEngine.Localization;
/// <summary>
/// Sets the default TextMeshPro font to be used.
/// </summary>
[ExecuteInEditMode]
public class DefaultTmpFont : MonoBehaviour
@alisci01
alisci01 / ParameterUpdateLogger.cs
Created July 29, 2022 18:43
Debugging script to help identify state machine transitions and updated parameters for Unity animators
using UnityEngine;
public class ParameterUpdateLogger : StateMachineBehaviour
{
[SerializeField]
string stateName = "RENAME ME!";
AnimatorControllerParameter[] animatorParams;
object[] animatorParamValues;
@karljj1
karljj1 / ObjectChangeEventsExample.cs
Last active June 17, 2025 15:40
Example of how to use ObjectChangeEvents in Unity
using System.Text;
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public class ObjectChangeEventsExample
{
static ObjectChangeEventsExample()
{
ObjectChangeEvents.changesPublished += ChangesPublished;
@raed667
raed667 / recruiters_developers.md
Last active May 5, 2022 15:31
Dear recruiters, here is why developers don’t respond to your messages

Dear recruiters, here is why developers don’t respond to your messages

All developers are familiar with the typical unsolicited recruiter messages. They are generic, usually feel spammy and it gives recruiters a bad reputation.

These messages usually go something like this:

Hey ${first_name},
I find your profile very interesting and I think you’re a great match for a role I’m recruiting for.
Let's schedule a call so I can tell you more about it.
@acoppes
acoppes / RefactorTools.cs
Last active April 30, 2022 09:33
Unity Editor helper methods to Refactor Data stored in Prefabs, Scenes and other Assets
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
namespace Utils.Editor
{
public static class RefactorTools
@darbotron
darbotron / ExampleSettings.cs
Last active June 6, 2022 09:11
Super easily (and extensibly) add a project global settings asset to the Unity Editor's project settings panels and/or edit in a floating window
//
// GenericUnityEditorSettings by Alex 'darbotron' Darby
//
// License: https://opensource.org/licenses/unlicense
// TL;DR:
// 1) you may do what you like with it...
// 2) ...except blame me for any consequence of acting on rule 1)
//
using UnityEngine;
using UnityEditor;