Skip to content

Instantly share code, notes, and snippets.

View ryan-at-melcher's full-sized avatar

ryan-at-melcher

View GitHub Profile
@ryan-at-melcher
ryan-at-melcher / FixAssetMainObjectNames.cs
Last active April 19, 2024 05:53
Automated/batch solution to fix "Main Object Name '{0}' does not match filename '{1}'" in Unity assets
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.PackageManager;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
/// <summary>
/// Adds a menu command to find and fix all assets that have mismatched main
/// object names and file names. I.e., "Main Object Name '{0}' does not match