-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectInfoText.cs
More file actions
50 lines (40 loc) · 1.62 KB
/
ProjectInfoText.cs
File metadata and controls
50 lines (40 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
namespace GalacticLib.Unity {
/// <summary> Commanders vX.x (Phase) - � Galacticai 2022 </summary>
public class ProjectInfoText : MonoBehaviour {
[SerializeField] private string gameName = "Commanders";
[SerializeField]
private bool showGameName = true,
showVersion = true,
showVersionMinor = true,
showPhase = true,
showCopyrightSymbol = true,
showDeveloperName = true,
showYear = true;
[SerializeField] private int year = 2022;
private void Start() {
TMP_Text _TMPText = GetComponent<TMP_Text>();
if (_TMPText == null) return;
List<string> infoList = new();
if (showGameName) infoList.Add(gameName);
string[] version = Application.version.Split('.');
if (showVersion)
infoList.Add(
$"v{version[0]}"
+ (showVersionMinor ? $".{version[1]}" : "")
);
if (showPhase) infoList.Add($"({(ProjectPhase)Convert.ToInt32(version[2])})");
if (showCopyrightSymbol
|| showDeveloperName
|| showYear)
infoList.Add("�");
if (showCopyrightSymbol) infoList.Add("�");
if (showDeveloperName) infoList.Add(Application.companyName);
if (showYear) infoList.Add(year.ToString());
_TMPText.text = string.Join(' ', infoList.ToArray());
}
}
}