mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-19 16:51:55 -05:00
デバッグ機能の消し忘れ
This commit is contained in:
parent
ed291eaf0f
commit
de3c1b48da
|
|
@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c0be718f3aba6ad4282a4b74eae9045b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue
Block a user