-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
44 additions
and
26 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 24 additions & 16 deletions
40
Unity 5/Assets/Scenes/Game/Scripts/Game/DontDestroyOnLoad.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class DontDestroyOnLoad : MonoBehaviour | ||
public class DontDestroyOnLoad : MonoBehaviour | ||
{ | ||
#region Input Data | ||
public string _accepted_level = "Game"; | ||
#endregion | ||
#region Input Data | ||
public string _accepted_level = "Game"; | ||
#endregion | ||
|
||
#region Unity | ||
void Awake() | ||
{ | ||
DontDestroyOnLoad(this.gameObject); | ||
} | ||
|
||
void OnLevelWasLoaded(int level) | ||
{ | ||
if (Application.loadedLevelName != this._accepted_level) | ||
Destroy(this.gameObject); | ||
} | ||
#endregion | ||
#region Unity | ||
void Awake() | ||
{ | ||
DontDestroyOnLoad(this.gameObject); | ||
SceneManager.sceneLoaded += LoadScene; | ||
} | ||
|
||
//void OnLevelWasLoaded(int level) | ||
//{ | ||
|
||
//} | ||
|
||
void LoadScene(Scene scene, LoadSceneMode mode) | ||
{ | ||
SceneManager.LoadScene(this._accepted_level); | ||
Destroy(this.gameObject); | ||
} | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class GameSetup : MonoBehaviour { | ||
|
||
public static BlockSet blockSet; | ||
|
||
void OnLevelWasLoaded(int level) { | ||
if(blockSet != null) GetComponent<Map>().SetBlockSet(blockSet); | ||
} | ||
void Awake() | ||
{ | ||
SceneManager.sceneLoaded += SceneManager_sceneLoaded; | ||
} | ||
|
||
private void SceneManager_sceneLoaded(Scene scene, LoadSceneMode mode) | ||
{ | ||
if (blockSet != null) GetComponent<Map>().SetBlockSet(blockSet); | ||
} | ||
|
||
// void OnLevelWasLoaded(int level) { | ||
//} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll.mdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll.mdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/metadata/00/00000000000000004000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Unity 5/Library/metadata/00/00000000000000006100000000000000
Binary file not shown.
Binary file modified
BIN
+24 Bytes
(100%)
Unity 5/Library/metadata/00/001442b3dff47da43b2ada5f92b51619
Binary file not shown.
Binary file modified
BIN
+200 Bytes
(100%)
Unity 5/Library/metadata/46/466d494647b3ce840bc06f67b96316ff
Binary file not shown.
Binary file modified
BIN
+48 Bytes
(100%)
Unity 5/Library/metadata/4b/4b75d1d55789a4241925af2942e5164d
Binary file not shown.
Binary file modified
BIN
+240 Bytes
(110%)
Unity 5/Library/metadata/92/92d707c3adf90d14aaac211e20f27691
Binary file not shown.