Skip to content

Commit

Permalink
Configure for WebGL.
Browse files Browse the repository at this point in the history
Add AutoSave
  • Loading branch information
HardlyDifficult authored and HardlyDifficult committed Dec 2, 2017
1 parent 9d58d30 commit 119df9f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Assets/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Assets/Scripts/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions Assets/Scripts/Editor/AutoSave.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using UnityEditor;
using UnityEditor.SceneManagement;

/// <summary>
/// An editor script which automatically saves every time you
/// hit play.
/// </summary>
[InitializeOnLoad]
public class AutoSave
{
#region Init
/// <summary>
/// Called before the game starts c/o InitializeOnLoad.
/// </summary>
static AutoSave()
{
EditorApplication.playmodeStateChanged
+= OnPlaymodeStateChanged;
}
#endregion

#region Events
/// <summary>
/// Called on enter/exit play mode and pause.
/// </summary>
static void OnPlaymodeStateChanged()
{
// Skip saving if in play mode, e.g. during pause
if (EditorApplication.isPlaying == false)
{
EditorSceneManager.SaveOpenScenes();
}
}
#endregion
}
13 changes: 13 additions & 0 deletions Assets/Scripts/Editor/AutoSave.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ GraphicsSettings:
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PlayerSettings:
defaultIsFullScreen: 1
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 0
runInBackground: 1
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
Expand Down

0 comments on commit 119df9f

Please sign in to comment.