Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Require More Unity5.6.0b4
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
[InitializeOnLoad]
public static class SceneEventCallback
{
static SceneEventCallback ()
{
// 新規シーン作成時Callback
EditorSceneManager.newSceneCreated += (scene, setup, mode) => {
Debug.Log ("newSceneCreated : " + scene + " / " + setup + " / " + mode);
};
// Unload or Remove完了
EditorSceneManager.sceneClosed += (scene) => {
Debug.Log ("sceneClosed : " + scene);
};
// Unload or Remove中
EditorSceneManager.sceneClosing += (scene, removingScene) => {
Debug.Log ("sceneClosing : " + scene + " / " + removingScene);
};
// シーンを開いた
EditorSceneManager.sceneOpened += (scene, mode) => {
Debug.Log ("sceneOpened : " + scene + " / " + mode);
};
// シーンを開き中
EditorSceneManager.sceneOpening += (path, mode) => {
Debug.Log ("sceneOpening : " + path + " / " + mode);
};
// シーン保存完了
EditorSceneManager.sceneSaved += (scene) => {
Debug.Log ("sceneSaved : " + scene);
};
// シーン保存中
EditorSceneManager.sceneSaving += (scene, path) => {
Debug.Log ("sceneSaving : " + scene + " / " + path);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.