Created
January 18, 2017 17:48
-
-
Save baobao/0030aff97085747c4db2304ee53774e3 to your computer and use it in GitHub Desktop.
Require More Unity5.6.0b4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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