Skip to content

Instantly share code, notes, and snippets.

@shinriyo
Last active October 24, 2018 11:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shinriyo/5563889 to your computer and use it in GitHub Desktop.
Save shinriyo/5563889 to your computer and use it in GitHub Desktop.
シーン保存時に実行される
using UnityEngine;
using UnityEditor;
using System.Collections;
public class SceneSaveHook : AssetModificationProcessor
{
static string[] OnWillSaveAssets (string[] paths)
{
foreach (string path in paths) {
if (path.EndsWith (".unity")) {
GameObject sceneMergerGO = GameObject.Find ("Scene Merger");
if (sceneMergerGO) {
SceneMerger merger = sceneMergerGO .GetComponent<SceneMerger> ();
merger.ClearOverlay ();
}
}
}
return paths;
}
}
@shinriyo
Copy link
Author

Scene MergerのGameObjectが無いときの処理を入れた。

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