39 lines
1004 B
C#
39 lines
1004 B
C#
using System;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using System.IO;
|
||
using System.Text;
|
||
using TMPro;
|
||
|
||
using UnityEngine;
|
||
|
||
public class ContactsLabel : MonoBehaviour
|
||
{
|
||
public string startText = "администрация: ";
|
||
TextMeshProUGUI label;
|
||
private void Start()
|
||
{
|
||
label = GetComponent<TextMeshProUGUI>();
|
||
SettingsManager.OnSettingsChanged.AddListener(pullSettings);
|
||
InvokeRepeating("pullSettings", 0, 10);
|
||
|
||
}
|
||
|
||
void pullSettings()
|
||
{
|
||
|
||
string contact;
|
||
if (PlayerPrefs.HasKey("Number"))
|
||
{
|
||
contact = PlayerPrefs.GetString("Number");
|
||
}
|
||
else contact = "<Не указано>";
|
||
|
||
//if (SettingsManager.instance.GetSettingValue("Показывать контакты администрации") == "Вкл")
|
||
if (SettingsManager.GetBool("ShowNumber", true))
|
||
label.text = startText + contact;
|
||
else
|
||
label.text = "";
|
||
}
|
||
}
|