-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* $File: JCS_QuitAppOnLoadEvent.cs $ | ||
* $Date: $ | ||
* $Revision: $ | ||
* $Creator: Jen-Chieh Shen $ | ||
* $Notice: See LICENSE.txt for modification and distribution information | ||
* Copyright (c) 2016 by Shen, Jen-Chieh $ | ||
*/ | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
using MyBox; | ||
|
||
namespace JCSUnity | ||
{ | ||
/// <summary> | ||
/// Event that skips the first scene for application load. | ||
/// </summary> | ||
public class JCS_SkipAppEvent : MonoBehaviour | ||
{ | ||
/* Variables */ | ||
|
||
/* Setter & Getter */ | ||
|
||
[Separator("Runtime Variables (JCS_SkipAppEvent)")] | ||
|
||
[Tooltip("The next starting scene to load.")] | ||
[SerializeField] | ||
private string mSceneName = ""; | ||
|
||
/* Functions */ | ||
|
||
private void Start() | ||
{ | ||
if (mSceneName == "") | ||
{ | ||
int nextIndex = SceneManager.GetActiveScene().buildIndex + 1; | ||
SceneManager.LoadScene(nextIndex); | ||
return; | ||
} | ||
|
||
SceneManager.LoadScene(mSceneName); | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Assets/JCSUnity/Scripts/Events/System/JCS_SkipAppEvent.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# JCS_SkipAppEvent | ||
|
||
Event that skips the first scene for application load. | ||
|
||
## Variables | ||
|
||
| Name | Description | | ||
|:-----------|:---------------------------------| | ||
| mSceneName | The next starting scene to load. | |