Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created March 27, 2017 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/d5c3a160e50b4b3ab7f1cb9420688263 to your computer and use it in GitHub Desktop.
Save tsubaki/d5c3a160e50b4b3ab7f1cb9420688263 to your computer and use it in GitHub Desktop.
ゲームのビルド前とビルド後に処理を行う
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Build;
using UnityEditor.Callbacks;
using UnityEditor;
public class Processor : IPreprocessBuild, IPostprocessBuild {
// ビルド前処理
public void OnPreprocessBuild (UnityEditor.BuildTarget target, string path)
{
var filePath = Application.streamingAssetsPath + "/01.png";
var nextPath = "StreamingAssetsTemp" + "/01.png";
System.IO.Directory.Move (filePath, nextPath);
}
// ビルド後処理
public void OnPostprocessBuild (BuildTarget target, string path)
{
var filePath = "StreamingAssetsTemp" + "/01.png";
var nextPath = Application.streamingAssetsPath + "/01.png";
System.IO.Directory.Move (filePath, nextPath);
}
// 実行順
public int callbackOrder { get { return 0; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment