-
-
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
4 changed files
with
53 additions
and
1 deletion.
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,38 @@ | ||
/** | ||
* $File: JCS_TimeScaleSlider.cs $ | ||
* $Date: 2023-09-03 14:19:04 $ | ||
* $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.UI; | ||
|
||
namespace JCSUnity | ||
{ | ||
/// <summary> | ||
/// Slider component to control time scale value. | ||
/// </summary> | ||
[RequireComponent(typeof(Slider))] | ||
public class JCS_TimeScaleSlider : MonoBehaviour | ||
{ | ||
/* Variables */ | ||
|
||
private Slider mSlider = null; | ||
|
||
/* Setter & Getter */ | ||
|
||
/* Functions */ | ||
|
||
private void Awake() | ||
{ | ||
this.mSlider = this.GetComponent<Slider>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
Time.timeScale = mSlider.value; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/JCSUnity/Scripts/UI/Slider/JCS_TimeScaleSlider.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# JCS_TimeScaleSlider | ||
|
||
Slider component to control time scale value. |