-
-
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
13 changed files
with
157 additions
and
10 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
Assets/JCSUnity/Scripts/UI/Button/System/JCS_ActionButton.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* $File: JCS_ActionButton.cs $ | ||
* $Date: 2023-07-29 12:05:00 $ | ||
* $Revision: $ | ||
* $Creator: Jen-Chieh Shen $ | ||
* $Notice: See LICENSE.txt for modification and distribution information | ||
* Copyright (c) 2023 by Shen, Jen-Chieh $ | ||
*/ | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
using MyBox; | ||
|
||
namespace JCSUnity | ||
{ | ||
/// <summary> | ||
/// Button that accept any event. | ||
/// </summary> | ||
public class JCS_ActionButton : JCS_Button | ||
{ | ||
/* Variables */ | ||
|
||
protected EmptyFunction onAction = null; | ||
|
||
[Separator("Runtime Variables (JCS_ActionButton)")] | ||
|
||
[Tooltip("Execute this when it's triggered.")] | ||
[SerializeField] | ||
protected UnityEvent mOnAction = null; | ||
|
||
/* Setter & Getter */ | ||
|
||
/* Functions */ | ||
|
||
/// <summary> | ||
/// On click event. | ||
/// </summary> | ||
public override void OnClick() | ||
{ | ||
Execute(); | ||
} | ||
|
||
/// <summary> | ||
/// Execute the action. | ||
/// </summary> | ||
public void Execute() | ||
{ | ||
if (onAction != null) | ||
onAction.Invoke(); | ||
|
||
if (mOnAction != null) | ||
mOnAction.Invoke(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/JCSUnity/Scripts/UI/Button/System/JCS_ActionButton.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
Assets/JCSUnity/Scripts/UI/Button/System/JCS_ActionGamePadButton.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* $File: JCS_ActionGamePadButton.cs $ | ||
* $Date: 2023-07-29 12:05:00 $ | ||
* $Revision: $ | ||
* $Creator: Jen-Chieh Shen $ | ||
* $Notice: See LICENSE.txt for modification and distribution information | ||
* Copyright (c) 2023 by Shen, Jen-Chieh $ | ||
*/ | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
using MyBox; | ||
|
||
namespace JCSUnity | ||
{ | ||
/// <summary> | ||
/// Button that accept any event. (Gamepad) | ||
/// </summary> | ||
public class JCS_ActionGamePadButton : JCS_GamepadButton | ||
{ | ||
/* Variables */ | ||
|
||
protected EmptyFunction onAction = null; | ||
|
||
[Separator("Runtime Variables (JCS_ActionGamePadButton)")] | ||
|
||
[Tooltip("Execute this when it's triggered.")] | ||
[SerializeField] | ||
protected UnityEvent mOnAction = null; | ||
|
||
/* Setter & Getter */ | ||
|
||
/* Functions */ | ||
|
||
/// <summary> | ||
/// On click event. | ||
/// </summary> | ||
public override void OnClick() | ||
{ | ||
Execute(); | ||
} | ||
|
||
/// <summary> | ||
/// Execute the action. | ||
/// </summary> | ||
public void Execute() | ||
{ | ||
if (onAction != null) | ||
onAction.Invoke(); | ||
|
||
if (mOnAction != null) | ||
mOnAction.Invoke(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/JCSUnity/Scripts/UI/Button/System/JCS_ActionGamePadButton.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
2 changes: 1 addition & 1 deletion
2
docs/ScriptReference/UI/Button/Scene/JCS_ExitAppGamePadButton.md
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,3 +1,3 @@ | ||
# JCS_ExitAppGamepadButton | ||
|
||
Please see [JCS_ExitAppButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_Scene_sl_JCS_ExitAppGamePadButton) | ||
Please see [JCS_ExitAppButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_Scene_sl_JCS_ExitAppGamePadButton). |
2 changes: 1 addition & 1 deletion
2
docs/ScriptReference/UI/Button/Scene/JCS_LoadSceneGamePadButton.md
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,3 +1,3 @@ | ||
# JCS_LoadSceneGamepadButton | ||
|
||
Please see [JCS_LoadSceneButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_Scene_sl_JCS_LoadSceneButton) | ||
Please see [JCS_LoadSceneButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_Scene_sl_JCS_LoadSceneButton). |
2 changes: 1 addition & 1 deletion
2
docs/ScriptReference/UI/Button/Scene/JCS_SlideScreenGamepadButton.md
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,3 +1,3 @@ | ||
# JCS_SlideScreenGamepadButton | ||
|
||
Please see [JCS_SlideScreenButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_JCS_SlideScreenButton) | ||
Please see [JCS_SlideScreenButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_Scene_sl_JCS_SlideScreenButton). |
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,16 @@ | ||
# JCS_ActionButton | ||
|
||
Echo out a string on the console window when this button triggered. | ||
|
||
## Variables | ||
|
||
| Name | Description | | ||
|:----------|:----------------------------------| | ||
| onAction | Callback when it's triggered. | | ||
| mOnAction | Execute this when it's triggered. | | ||
|
||
## Functions | ||
|
||
| Name | Description | | ||
|:--------|:--------------------| | ||
| Execute | Execute the action. | |
3 changes: 3 additions & 0 deletions
3
docs/ScriptReference/UI/Button/System/JCS_ActionGamePadButton.md
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,3 @@ | ||
# JCS_ActionGamePadButton | ||
|
||
Please see [JCS_ActionButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_ActionButton). |
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,3 +1,3 @@ | ||
# JCS_EchoGamepadButton | ||
|
||
Please see [JCS_EchoButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_EchoButton) | ||
Please see [JCS_EchoButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_EchoButton). |
2 changes: 1 addition & 1 deletion
2
docs/ScriptReference/UI/Button/System/JCS_EmptyGamePadButton.md
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,3 +1,3 @@ | ||
# JCS_EmptyGamepadButton | ||
|
||
Please see [JCS_EmptyButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_EmptyButton) | ||
Please see [JCS_EmptyButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_EmptyButton). |
2 changes: 1 addition & 1 deletion
2
docs/ScriptReference/UI/Button/System/JCS_ToggleGamePadButton.md
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,3 +1,3 @@ | ||
# JCS_ToggleGamepadButton | ||
|
||
Please see [JCS_ToggleButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_ToggleButton) | ||
Please see [JCS_ToggleButton](https://jcs090218.github.io/JCSUnity/ScriptReference/index.html?page=UI_sl_Button_sl_System_sl_JCS_ToggleButton). |