コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【C#】.unitypackage から GUID のリストを取得する方法

概要

「SharpCompress」を使用して

using SharpCompress.Readers;
using System;
using System.IO;

public static class Program
{
    private static void Main()
    {
        var path = "【.unitypackage のパス】";

        using ( var stream = File.OpenRead( path ) )
        {
            var reader = ReaderFactory.Open( stream );

            while ( reader.MoveToNextEntry() )
            {
                if ( reader.Entry.IsDirectory )
                {
                    Console.WriteLine( reader.Entry.Key );
                }
            }
        }
    }
}

上記のようなコードを記述する