Skip to content

Commit

Permalink
feat(UI): Add version text
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Aug 2, 2023
1 parent ff4a144 commit 3708058
Show file tree
Hide file tree
Showing 7 changed files with 659 additions and 24 deletions.
8 changes: 8 additions & 0 deletions Assets/JCSUnity/Scripts/UI/Version.meta

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

44 changes: 44 additions & 0 deletions Assets/JCSUnity/Scripts/UI/Version/JCS_VersionText.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* $File: JCS_VersionText.cs $
* $Date: 2023-08-02 $
* $Revision: $
* $Creator: Jen-Chieh Shen $
* $Notice: See LICENSE.txt for modification and distribution information
* Copyright (c) 2023 by Shen, Jen-Chieh $
*/
using UnityEngine;
using MyBox;

namespace JCSUnity
{
/// <summary>
/// Display version number.
/// </summary>
public class JCS_VersionText : JCS_TextObject
{
/* Variables */

[Separator("Initialize Variables (JCS_VersionText)")]

[Tooltip("Format string to show version text.")]
[SerializeField]
public string mFormat = "v{0}";

/* Setter & Getter */

/* Functions */

private void Awake()
{
UpdateVersionNo();
}

/// <summary>
/// Update the version number once.
/// </summary>
public void UpdateVersionNo()
{
this.text = string.Format(mFormat, Application.version);
}
}
}
11 changes: 11 additions & 0 deletions Assets/JCSUnity/Scripts/UI/Version/JCS_VersionText.cs.meta

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

Loading

0 comments on commit 3708058

Please sign in to comment.