XRoom_Unity/Assets/EN.cs
2025-05-31 10:20:20 +03:30

75 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Android;
using static ENMenu;
public class EN : MonoBehaviour
{
//[System.Serializable]
//public class User
//{
// public int id;
// public string name;
// public string job;
// public GameObject character;
//}
public static EN instance;
public List<User> users = new List<User>();
public User SelectedUser;
public User Me;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Awake()
{
if(EN.instance)
{
Destroy(gameObject);
return;
}
DontDestroyOnLoad(this.gameObject);
instance = this;
}
public void Start()
{
if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
{
Permission.RequestUserPermission(Permission.Microphone);
}
// StartCoroutine(webservice.instance. LoginRequest(OnLoginSuccess));
}
public GameObject Error;
public void showError(string title,string description)
{
CancelInvoke("hideError");
gameObject.transform .position= GameObject.FindGameObjectWithTag("anocher").transform.position;
gameObject.transform .rotation= GameObject.FindGameObjectWithTag("anocher").transform.rotation;
Error.SetActive(true);
Error.transform.Find("error/title").GetComponentInChildren<RTLTMPro.RTLTextMeshPro>().text = title;
Error.transform.Find("error/description").GetComponentInChildren<RTLTMPro.RTLTextMeshPro>().text = description;
Invoke("hideError", 6);
}
public void hideError()
{
Error.SetActive(false);
}
// Update is called once per frame
void Update()
{
}
internal void Print(string j)
{
print(j);
}
}