Skip to content

Instantly share code, notes, and snippets.

@onotchi
Created April 12, 2023 05:01
Show Gist options
  • Save onotchi/116d2acda0e55ef31e526800fefffdbf to your computer and use it in GitHub Desktop.
Save onotchi/116d2acda0e55ef31e526800fefffdbf to your computer and use it in GitHub Desktop.
UnityでBuild後にUnity.exeのファイル更新日時を上書きする
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
public class BuildPostprocessor
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
//Exeの最終更新日時を現在時刻で上書き
File.SetLastWriteTime(pathToBuiltProject, DateTime.Now);
}
}
@onotchi
Copy link
Author

onotchi commented Apr 12, 2023

任意のEditorフォルダの中に上記ソースを置いてビルドすればOK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment