Skip to content

Instantly share code, notes, and snippets.

@maierfelix
maierfelix / main.js
Last active August 9, 2024 14:45
Parsing Unity .asset - "_typelessdata" field
// input example: A simple Quad
// field `_typelessdata`
mesh = `000080bf000080bf0000000000000000000000000000803f00000000000000000000803f000080bf0000000000000000000000000000803f0000803f00000000000080bf0000803f0000000000000000000000000000803f000000000000803f0000803f0000803f0000000000000000000000000000803f0000803f0000803f`;
// field `m_IndexBuffer`
index = `0000010002000300`;
// normalize
mesh = normalizeString(mesh);
index = normalizeString(index);
@HelloKitty
HelloKitty / Quaternion.cs
Last active May 25, 2025 20:40 — forked from JakubNei/MyQuaternion.cs
A custom completely managed implementation of UnityEngine.Quaternion. Base is decompiled UnityEngine.Quaternion. Doesn't implement methods marked Obsolete. Does implicit coversions to and from UnityEngine.Quaternion
// A custom completely managed implementation of UnityEngine.Quaternion
// Base is decompiled UnityEngine.Quaternion
// Doesn't implement methods marked Obsolete
// Does implicit coversions to and from UnityEngine.Quaternion
// Uses code from:
// https://raw.githubusercontent.com/mono/opentk/master/Source/OpenTK/Math/Quaternion.cs
// http://answers.unity3d.com/questions/467614/what-is-the-source-code-of-quaternionlookrotation.html
// http://stackoverflow.com/questions/12088610/conversion-between-euler-quaternion-like-in-unity3d-engine
// http://stackoverflow.com/questions/11492299/quaternion-to-euler-angles-algorithm-how-to-convert-to-y-up-and-between-ha