|
|
@@ -1,17 +1,25 @@
|
|
|
+let currentScene = 'TombstoneView'
|
|
|
+
|
|
|
//场景加载进度回调
|
|
|
-window.loadSceneProgress = function(progress){
|
|
|
- if (window.parent && window.parent !== window) {
|
|
|
- window.parent.unityLoading(progress);
|
|
|
- }
|
|
|
+window.loadSceneProgress = function (progress) {
|
|
|
+ if (window.parent && window.parent !== window) {
|
|
|
+ window.parent.unityLoading(progress)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//设置场景加载完毕时透明度渐变的时长(秒), 0为去除该效果
|
|
|
-window.setLoadSceneAnimationTime = function(animationTime){
|
|
|
- window.unityInstance.SendMessage('SceneLoader', 'SetAnimationTime', animationTime)
|
|
|
+window.setLoadSceneAnimationTime = function (animationTime) {
|
|
|
+ window.unityInstance.SendMessage('SceneLoader', 'SetAnimationTime', animationTime)
|
|
|
}
|
|
|
|
|
|
//切换场景 场景支持以下参数 "TombstoneView", "RoomScene", "DrawingBoard"
|
|
|
-window.loadScene = function(sceneName){
|
|
|
- window.setLoadSceneAnimationTime(sceneName === 'DrawingBoard' ? 1 : 0);
|
|
|
- window.unityInstance.SendMessage('SceneLoader', 'LoadScene', sceneName)
|
|
|
+window.loadScene = function (sceneName) {
|
|
|
+ window.setLoadSceneAnimationTime(sceneName === 'DrawingBoard' ? 1 : 0)
|
|
|
+ window.unityInstance.SendMessage('SceneLoader', 'LoadScene', sceneName)
|
|
|
+ currentScene = sceneName
|
|
|
+}
|
|
|
+
|
|
|
+// 返回当前场景状态
|
|
|
+window.sceneStaRes = () => {
|
|
|
+ return currentScene
|
|
|
}
|