Skip to content

Instantly share code, notes, and snippets.

View AsyncOperator's full-sized avatar
🎯
Focusing

Nihat Hakan Altıparmak AsyncOperator

🎯
Focusing
View GitHub Profile
@AsyncOperator
AsyncOperator / Shortcuts
Created July 7, 2025 18:17
Useful for quickly inspecting serialized/private fields or locking focus on selected objects. Ideal for debugging and advanced editor usage.
[Shortcut("AsyncOperator/Toggle Inspector Lock", KeyCode.Q, ShortcutModifiers.Alt)]
private static void ToggleInspectorLock()
{
if (ActiveEditorTracker.sharedTracker.activeEditors.Length > 0)
{
ActiveEditorTracker.sharedTracker.isLocked = !ActiveEditorTracker.sharedTracker.isLocked;
ActiveEditorTracker.sharedTracker.ForceRebuild();
}
}
@AsyncOperator
AsyncOperator / CollectionPoolScope
Last active July 6, 2025 23:22
Utility structs for scoped usage of pooled List<T>, HashSet<T>, and Dictionary<TKey, TValue> in Unity.
public readonly struct ListPoolScope<T> : IDisposable
{
public readonly List<T> list;
private ListPoolScope(List<T> list)
{
this.list = list;
}
public static ListPoolScope<T> Rent()