SampleCopy 済みか確認する

This commit is contained in:
ousttrue 2023-07-05 13:44:32 +09:00
parent 9d4d5e97a6
commit 5a87e0a4bf
2 changed files with 38 additions and 3 deletions

View File

@ -1,11 +1,30 @@
using System;
using System.IO;
using System.Linq;
using UnityEngine;
namespace VRM
{
public static class VRMSampleCopy
{
struct CopyInfo
{
public string Src;
public string Dst;
public CopyInfo(string src, string dst)
{
Src = src;
Dst = dst;
}
}
static CopyInfo[] CopyList = new CopyInfo[]{
new CopyInfo(Path.Combine(Application.dataPath, "VRM_Samples"), Path.Combine(Application.dataPath, "VRM/Samples~")),
new CopyInfo(Path.Combine(Application.dataPath, "VRM10_Samples"), Path.Combine(Application.dataPath, "VRM10/Samples~")),
new CopyInfo(Path.Combine(Application.dataPath, "UniGLTF_Samples"), Path.Combine(Application.dataPath, "UniGLTF/Samples~")),
};
/// <summary>
/// Assets/VRM_Samples
/// を
@ -24,9 +43,10 @@ namespace VRM
/// </summary>
public static void Execute()
{
Copy(Path.Combine(Application.dataPath, "VRM_Samples"), Path.Combine(Application.dataPath, "VRM/Samples~"));
Copy(Path.Combine(Application.dataPath, "VRM10_Samples"), Path.Combine(Application.dataPath, "VRM10/Samples~"));
Copy(Path.Combine(Application.dataPath, "UniGLTF_Samples"), Path.Combine(Application.dataPath, "UniGLTF/Samples~"));
foreach (var info in CopyList)
{
Copy(info.Src, info.Dst);
}
}
static void Copy(string srcDir, string dstDir)
@ -61,5 +81,15 @@ namespace VRM
throw new FileNotFoundException(src);
}
}
public static bool Validate()
{
return CopyList.All(x => Validate(x.Src, x.Dst));
}
static bool Validate(string srcDir, string dstDir)
{
return false;
}
}
}

View File

@ -187,6 +187,11 @@ namespace VRM.DevOnly.PackageExporter
public static void CreateUnityPackages(string outputDir)
{
if (!VRMSampleCopy.Validate())
{
throw new Exception("No Sample Copy !");
}
{
var packages = new[]{
// VRM