Skip to content

Commit

Permalink
feat: Add new component JCS_AppSkip
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Apr 29, 2024
1 parent b042ae9 commit e5423f9
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 2 deletions.
48 changes: 47 additions & 1 deletion Assets/JCSUnity/Scenes/System/JCS_AppSkip.unity
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,53 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &762334593
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 762334594}
- component: {fileID: 762334595}
m_Layer: 0
m_Name: _AppSkip
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &762334594
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 762334593}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &762334595
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 762334593}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec6f96c366e0035439f99440d230454b, type: 3}
m_Name:
m_EditorClassIdentifier:
mSceneName:
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots: []
m_Roots:
- {fileID: 762334594}
44 changes: 44 additions & 0 deletions Assets/JCSUnity/Scripts/Events/System/JCS_SkipAppEvent.cs
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);
}
}
}

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

6 changes: 5 additions & 1 deletion ProjectSettings/EditorBuildSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/JCSUnity/Scenes/System/JCS_AppSkip.unity
guid: 108ae7f86943bb248b2be397529ebdd1
- enabled: 1
path: Assets/_Project/Scenes/System/FT_Resizable.unity
guid: be4c2ec23b20bb449b1a0c85bc684b40
Expand Down Expand Up @@ -57,6 +60,7 @@ EditorBuildSettings:
path: Assets/_Project/Scenes/Obsolete/JCS_2DAI.unity
guid: a7192e9fe705d574c8b921528811f52f
- enabled: 1
path: Assets/JCSUnity/Scenes/Demo/GUI/JCS_GamePadUIHandler.unity
path: Assets/JCSUnity/Scenes/Demo/GUI/JCS_GamepadUIHandler.unity
guid: c6763af20233ccb43b62412e9dab766a
m_configObjects: {}
m_UseUCBPForAssetBundles: 0
9 changes: 9 additions & 0 deletions docs/ScriptReference/Events/System/JCS_SkipAppEvent.md
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. |

0 comments on commit e5423f9

Please sign in to comment.