Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using UnityEngine;
using UnityEditor;
using System.IO;
public static void ImportVideoClip ()
{
string movieDirPath = "動画までのディレクトリパス/";
string dirPath = Application.dataPath + movieDirPath;
// 適宜条件を指定してファイルパスを取得
var videoClipFilePathList = Directory.GetFiles (dirPath, "*mov", SearchOption.TopDirectoryOnly);
foreach (var p in videoClipFilePathList) {
var videoClipFileName = Path.GetFileName (p);
Debug.Log (videoClipFileName);
// ReImport処理
AssetDatabase.ImportAsset ("Assets/" + movieDirPath + videoClipFileName, ImportAssetOptions.ForceUpdate);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment