Skip to content

Commit 3708058

Browse files
committed
feat(UI): Add version text
1 parent ff4a144 commit 3708058

File tree

7 files changed

+659
-24
lines changed

7 files changed

+659
-24
lines changed

Assets/JCSUnity/Scripts/UI/Version.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* $File: JCS_VersionText.cs $
3+
* $Date: 2023-08-02 $
4+
* $Revision: $
5+
* $Creator: Jen-Chieh Shen $
6+
* $Notice: See LICENSE.txt for modification and distribution information
7+
* Copyright (c) 2023 by Shen, Jen-Chieh $
8+
*/
9+
using UnityEngine;
10+
using MyBox;
11+
12+
namespace JCSUnity
13+
{
14+
/// <summary>
15+
/// Display version number.
16+
/// </summary>
17+
public class JCS_VersionText : JCS_TextObject
18+
{
19+
/* Variables */
20+
21+
[Separator("Initialize Variables (JCS_VersionText)")]
22+
23+
[Tooltip("Format string to show version text.")]
24+
[SerializeField]
25+
public string mFormat = "v{0}";
26+
27+
/* Setter & Getter */
28+
29+
/* Functions */
30+
31+
private void Awake()
32+
{
33+
UpdateVersionNo();
34+
}
35+
36+
/// <summary>
37+
/// Update the version number once.
38+
/// </summary>
39+
public void UpdateVersionNo()
40+
{
41+
this.text = string.Format(mFormat, Application.version);
42+
}
43+
}
44+
}

Assets/JCSUnity/Scripts/UI/Version/JCS_VersionText.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)