Skip to content

Instantly share code, notes, and snippets.

@t0chas
t0chas / CustomEditorBase.cs
Last active September 2, 2024 06:54
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@StagPoint
StagPoint / Morton2D.cs
Last active May 6, 2024 15:45
Represents 2D Morton Codes by interleaving two 16-bit unsigned integer values into a 32-bit unsigned integer.
// **************************************************
// EXAMPLE USAGE:
//
// // Returns a single value with arguments x and y interleaved
// var code = MortonCode2D.Interleave( 123, 456 );
//
// // Extracts the interleaved values (123 and 456) into integer variables x and y
// MortonCode2D.Deinterleave( code, out int x, out int y )
//
// **************************************************
@StagPoint
StagPoint / NativePriorityQueue.cs
Last active June 29, 2024 19:29
Priority queue implementation for Unity that uses Native Containers for data storage. This version relies on the stored type implementing the IComparable<T> interface.
// Copyright 2017-2021 StagPoint Software
namespace StagPoint.Collections
{
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;