Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Assets.Scripts;
- using UnityEngine;
- using UnityEngine.UI;
- public class Watermark : MonoBehaviour
- {
- private Text _text;
- private Text2 _text;
- private Text3 _text;
- private GridLayoutGroup _gridLayoutGroup;
- void Awake()
- {
- _text = GetComponentInChildren<Text>();
- _text2 = GetComponentInChildren<Text2>();
- _text3 = GetComponentInChildren<Text3>();
- _gridLayoutGroup = GetComponentInChildren<GridLayoutGroup>();
- GameObject logo = _gridLayoutGroup.transform.GetChild(0).gameObject;
- for (int x = 0; x < _gridLayoutGroup.constraintCount * _gridLayoutGroup.constraintCount - 1; x++)
- Instantiate(logo, _gridLayoutGroup.transform);
- UpdateText();
- InvokeRepeating(nameof(UpdateInfo), 0.0f, 60.0f);
- }
- void Start()
- {
- #if UNITY_EDITOR
- gameObject.SetActive(false);
- #else
- gameObject.SetActive(GameSettings.DevelopmentEnvironment());
- #endif
- }
- public void OnDisable()
- {
- CancelInvoke(nameof(UpdateInfo));
- }
- public void UpdateInfo()
- {
- UpdateText();
- if (User.Groups.Contains(User.Group.IgnoreWatermark) || User.Groups.Contains(User.Group.Developer))//specjalnie dla Trichlora :3
- gameObject.SetActive(false);
- }
- private void UpdateText()
- {
- _text.text = $"{User.Identificator} {User.UniqueId}\nv{GameSettings.Version} \"{GameSettings.CodeName}\" {GameSettings.RunMode}\n{DateTime.Now:yyyy-MM-dd_HH-mm}";
- _text2.text = $"{User.Identificator} {User.UniqueId}\nv{GameSettings.Version} \"{GameSettings.CodeName}\" {GameSettings.RunMode}\n{DateTime.Now:yyyy-MM-dd_HH-mm}";
- _text3.text = $"{User.Identificator} {User.UniqueId}\nv{GameSettings.Version} \"{GameSettings.CodeName}\" {GameSettings.RunMode}\n{DateTime.Now:yyyy-MM-dd_HH-mm}";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement