/
crypt
/
NumbersPlay
Обзор
Документация
Войти
/
crypt
/
NumbersPlay
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Assets/PluginYourGames/Example/Scripts/BasicData.cs
45 строк
1 KB
Crypt
start
16 ноя 2025, 14:28
16 ноя 2025, 14:28
1482007
Код
Авторство
О чём код?
using UnityEngine; using UnityEngine.UI; namespace YG.Example { public class BasicData : MonoBehaviour { public Text dataText; private void OnEnable() { YG2.onGetSDKData += DrawText; YG2.onFocusWindowGame += OnDrawTextHostBool; YG2.onPauseGame += OnDrawTextHostBool; } private void OnDisable() { YG2.onGetSDKData -= DrawText; YG2.onFocusWindowGame -= OnDrawTextHostBool; YG2.onPauseGame -= OnDrawTextHostBool; } private void Start() { DrawText(); } public void DrawText() { string platformName = $"platform = <color=#cd5200>{YG2.platform}</color>"; string isFirstGameSession = $"is First Game Session = {YG2.isFirstGameSession.ToString()}"; string gameplaying = $"is Gameplaying = {YG2.isGameplaying.ToString()}"; string pauseGame = $"is Pause Game = {YG2.isPauseGame.ToString()}"; string buildNumber = $"build Number = {YG2.buildNumber.ToString()}"; dataText.text = $"{platformName}\n{isFirstGameSession}\n{gameplaying}\n{pauseGame}\n{buildNumber}"; } private void OnDrawTextHostBool(bool b) { DrawText(); } } }