赞
踩
虽然脚本图片这些东西可以自动保存,但是场景中的控件不会自动,需要增加以下控件。
Asset->创建Editor->创建autosave.cs,脚本代码如下:
- using UnityEditor;
- using UnityEngine;
- using UnityEditor.SceneManagement;
-
- [InitializeOnLoad]
- public class AutoSave
- {
- static AutoSave()
- {
- EditorApplication.playModeStateChanged += (PlayModeStateChange state) => {
- if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
- {
- EditorSceneManager.SaveOpenScenes();
- AssetDatabase.SaveAssets();
- }
- };
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。