38 lines
921 B
C#
38 lines
921 B
C#
|
using System.Collections;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class UpdateAvailable : MonoBehaviour
|
||
|
{
|
||
|
public Text Header;
|
||
|
public Text CurrentVersion;
|
||
|
public Text NewVersion;
|
||
|
public System.Action OnDownloadAction;
|
||
|
public System.Action OnIgnoreAction;
|
||
|
public System.Action OnIgnorePersistentAction;
|
||
|
public Button IgnorePersistentButton;
|
||
|
|
||
|
public UpdateAvailable Init(string title, string currentVersion, string newVersion)
|
||
|
{
|
||
|
Header.text = title;
|
||
|
CurrentVersion.text = "Current: " + currentVersion;
|
||
|
NewVersion.text = "Update: " + newVersion;
|
||
|
gameObject.SetActive(true);
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public void OnDownload()
|
||
|
{
|
||
|
OnDownloadAction?.Invoke();
|
||
|
}
|
||
|
|
||
|
public void OnIgnore()
|
||
|
{
|
||
|
OnIgnoreAction?.Invoke();
|
||
|
}
|
||
|
|
||
|
public void OnIgnorePersistent()
|
||
|
{
|
||
|
OnIgnorePersistentAction?.Invoke();
|
||
|
}
|
||
|
}
|