mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2025-12-21 21:16:04 +01:00
24 lines
679 B
C#
24 lines
679 B
C#
using UnityEngine;
|
|
using TMPro;
|
|
|
|
public class GameInfoInjector : MonoBehaviour
|
|
{
|
|
public TextMeshProUGUI infoText;
|
|
|
|
private void Start()
|
|
{
|
|
if (!infoText)
|
|
{
|
|
Debug.LogError($"{nameof(GameInfoInjector)}: {nameof(infoText)} is not set!");
|
|
return;
|
|
}
|
|
var buildInfo = Resources.Load<TextAsset>("BuildInfo");
|
|
var buildDate = buildInfo ? buildInfo.ToString().Trim() : "undefined";
|
|
|
|
var text = infoText.text.Replace("{gamever}", Application.version)
|
|
.Replace("{unityver}", Application.unityVersion)
|
|
.Replace("{builddate}", buildDate);
|
|
|
|
infoText.text = text;
|
|
}
|
|
}
|