http://code.google.com/p/shadow-force/source/browse/trunk/Assets/Scripts/Misc/InitLevelManager.cs?r=18
public class InitLevelManager : MonoBehaviour
{
public Texture2D splash;
private Texture2D background;
private bool loading = true;
void Start ()
{
background = new Texture2D (2, 2);
background.SetPixels (new Color[] {Color.black, Color.black, Color.black, Color.black});
background.Apply ();
DontDestroyOnLoad (gameObject);
Application.LoadLevel (Application.loadedLevel + 1);
}
void OnLevelWasLoaded (int level)
{
loading = false;
}
void OnGUI ()
{
if (!loading)
{
return;
}
float splashWidth = splash.width, splashHeight = splash.height;
if (splashWidth > Screen.width)
{
float scale = Screen.width / splashWidth;
splashWidth *= scale;
splashHeight *= scale;
}
GUI.DrawTexture (new Rect (0.0f, 0.0f, Screen.width, Screen.height), background);
GUI.DrawTexture (
new Rect (
(Screen.width - splashWidth) * 0.5f,
(Screen.height - splashHeight) * 0.5f,
splashWidth,
splashHeight
),
splash
);
}
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [펌]유니티 구글드라이브 연동 소스 (0) | 2013.12.10 |
|---|---|
| 유니티 포물선 공식 (1) | 2013.12.09 |
| 유니티 대화 예제 (0) | 2013.12.09 |
| 유니티 text 파일로 저장하는 법 (0) | 2013.12.09 |
| [펌] 유니티 런닝게임 관련 질문 (0) | 2013.12.06 |
| [펌] 유니티 러너 게임 질문 (0) | 2013.12.06 |
import System; import System.IO; var fileName = "MyFile.txt"; { if (File.Exists(fileName)) { return; } var sr = File.CreateText(fileName); sr.WriteLine ("This is my file."); sr.WriteLine ("I can write ints {0} or floats {1}, and so on.", 1, 4.2); }
'잡다한것들전부 > 팁' 카테고리의 다른 글
| 유니티 포물선 공식 (1) | 2013.12.09 |
|---|---|
| 유니티 대화 예제 (0) | 2013.12.09 |
| 유니티 text 파일로 저장하는 법 (0) | 2013.12.09 |
| [펌] 유니티 런닝게임 관련 질문 (0) | 2013.12.06 |
| [펌] 유니티 러너 게임 질문 (0) | 2013.12.06 |
| [펌] 유니티 메모리 관리 (0) | 2013.12.05 |
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 안드로이드 동적 생성 view button progressbar 등 (0) | 2014.01.06 |
|---|---|
| 뒤로가기 버튼 클릭시 종료 팝업후 종료 하기 (0) | 2013.12.30 |
| INSTALL_FAILED_INSUFFICIENT_STORAGE 오류시 (0) | 2013.12.30 |
| Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE (0) | 2013.12.16 |
| 프로젝트 오른쪽클릭 ->안드로이드툴->Fix 클릭 하시면되용 (0) | 2013.12.16 |
| gcm 예제 (0) | 2013.12.06 |
GcmTest.zip

