You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
938 B
C#
34 lines
938 B
C#
3 months ago
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
namespace Lofelt.NiceVibrations
|
||
|
{
|
||
|
[RequireComponent(typeof(Text))]
|
||
|
public class VersionNumber : MonoBehaviour
|
||
|
{
|
||
|
public string Version = "v3.3";
|
||
|
|
||
|
protected Text _text;
|
||
|
|
||
|
protected virtual void Awake()
|
||
|
{
|
||
|
_text = this.gameObject.GetComponent<Text>();
|
||
|
}
|
||
|
|
||
|
protected virtual void Start()
|
||
|
{
|
||
|
// There is not much space in the text, so make the string for alpha
|
||
|
// and beta versions a bit shorter
|
||
|
_text.text = Version.Replace("-alpha.", "a").Replace("-beta.", "b");
|
||
|
|
||
|
#if (UNITY_IOS && !UNITY_EDITOR)
|
||
|
_text.text += " iOS " + DeviceCapabilities.platformVersion.ToString();
|
||
|
#elif (UNITY_ANDROID && !UNITY_EDITOR)
|
||
|
_text.text += " Android " + DeviceCapabilities.platformVersion.ToString();
|
||
|
#endif
|
||
|
}
|
||
|
}
|
||
|
}
|