chip-game/Assets/Scripts/ContactsLabel.cs

39 lines
1004 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 = "";
}
}