デバッグ機能の消し忘れ

This commit is contained in:
ousttrue 2022-09-21 15:25:59 +09:00
parent ed291eaf0f
commit de3c1b48da
2 changed files with 0 additions and 67 deletions

View File

@ -1,56 +0,0 @@
using System.IO;
using UnityEditor;
using UnityEngine;
namespace UniVRM10
{
public static class MigrationMenu
{
static VRMShaders.PathObject s_lastPath = VRMShaders.PathObject.UnityAssets;
const string CONTEXT_MENU = "Assets/Migration: Vrm1";
[MenuItem(CONTEXT_MENU, true)]
static bool Enable()
{
if (!VRMShaders.PathObject.TryGetFromAsset(Selection.activeObject, out VRMShaders.PathObject path))
{
return false;
}
var isVrm = path.Extension.ToLower() == ".vrm";
return isVrm;
}
[MenuItem(CONTEXT_MENU, false)]
static void Exec()
{
if (!VRMShaders.PathObject.TryGetFromAsset(Selection.activeObject, out VRMShaders.PathObject path))
{
return;
}
// migrate
var vrm1Bytes = MigrationVrm.Migrate(path.ReadAllBytes());
if (!s_lastPath.TrySaveDialog("Save vrm1 file", $"{path.Stem}_vrm1", out VRMShaders.PathObject dst))
{
return;
}
s_lastPath = dst.Parent;
// write result
dst.WriteAllBytes(vrm1Bytes);
if (dst.IsUnderAsset)
{
// immediately import for GUI update
Debug.Log($"import: {dst}");
dst.ImportAsset();
}
else
{
Debug.Log($"write: {dst}");
}
}
}
}

View File

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c0be718f3aba6ad4282a4b74eae9045b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: