블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2341)N
Unity3D (577)
Programming (473)
Unreal (4)
Gamebryo (56)
Tip & Tech (186)N
협업 (34)
3DS Max (3)
Game (12)
Utility (116)
Etc (92)
Link (31)
Portfolio (19)
Subject (90)
iOS,OSX (38)
Android (13)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (1)
Memories (20)
Interest (37)
Thinking (36)
한글 (26)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (19)
Exercise (3)
나만의 맛집 (2)
냥이 (9)
육아 (13)
Total1,355,263
Today21
Yesterday363
Statistics Graph

달력

« » 2020.1
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

공지사항

태그목록

Unity Crash

I’m sure it’s happened to every Unity developer with some frequency: You’re there working on something, totally in the flow and getting mad work done, and all of a sudden BAM! Unity crashes. Unfortunately for you, you’ve probably been so “in the zone” that you haven’t saved the last fifteen minutes or more of that work.

Yes, learning to press CTRL-S regularly is the most effective solution possible, but everyone forgets once in a while and the price for forgetting can sometimes be particularly high.

One thing that would help is if Unity could auto-save your scene for you, and there are a number of Unity editor extensions out there to help you, but it seems the majority of them are either more complicated than you need or don’t quite work right. That’s why I wrote the following script, which saves the current scene prior to entering Play mode when you press the Play button. It requires no configuration, and doesn’t distract you from the ultimately most important task of developing your game.  There are no editor windows to keep open, no menu options that need to be clicked.

If this sounds helpful to you, you can either copy the code below into a C# script file somewhere in an Editor folder in your project, or click the button below to download a zipped .unitypackage that can be easily imported into your project.


Download “AutoSave on Run Script”AutoSaveOnRun.zip – Downloaded 58 times – 2 kB

[code lang="csharp" toolbar="true" title="AutoSaveOnRun.cs"]
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;

using UnityEngine;
using UnityEditor;

[InitializeOnLoad]
public class AutoSaveOnRun
{

static AutoSaveOnRun()
{

EditorApplication.playmodeStateChanged = () =>
{

if( EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying )
{

Debug.Log( "Auto-Saving scene before entering Play mode: " + EditorApplication.currentScene );

EditorApplication.SaveScene();
EditorApplication.SaveAssets();
}

};

}

}
[/code]
I really do hope you find this as useful as I have!


출처 : http://www.daikonforge.com/dfgui/save-on-run/

'Unity3D > Extensions' 카테고리의 다른 글

ObjectPool  (0) 2014.04.22
인스펙터 상의 GUI를 비활성화 시키고 싶을 때..  (0) 2014.04.02
Save Scene while on play mode  (0) 2014.01.12
Auto-Save Scene on Run  (0) 2014.01.12
Combine Children Extented (sources to share)  (0) 2013.01.17
SpriteManager  (0) 2012.11.24
Posted by blueasa

댓글을 달아 주세요