Skip to content

Instantly share code, notes, and snippets.

View megalon's full-sized avatar

megalon megalon

View GitHub Profile
@megalon
megalon / AssetPostProcessorReorderBonesEditor.cs
Created November 12, 2023 06:23
Unity custom model importing scripts for mods
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
//sorts transform bone indexes in skinned mesh renderers so that we can swap skinned meshes at runtime
public class AssetPostProcessorReorderBonesEditor : AssetPostprocessor
{
private string targetObjectName = "object-name-here";
private List<string> CorrectBoneOrder = new List<string> {