Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active December 28, 2015 18:29
Show Gist options
  • Save tsubaki/7543089 to your computer and use it in GitHub Desktop.
Save tsubaki/7543089 to your computer and use it in GitHub Desktop.
プレイモード切替時にプレハブを保存する。使用するにはEditorフォルダ以下に配置しておく。
using System.Collections;
using UnityEditor;
[InitializeOnLoad]
public class SceneSave
{
static SceneSave ()
{
EditorApplication.playmodeStateChanged = () =>
{
if (EditorApplication.isPlayingOrWillChangePlaymode) {
EditorApplication.SaveAssets ();
//EditorApplication.SaveScene ();
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment