using System.Diagnostics;
using System.Reflection;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class CHELcommunications : MonoBehaviour, IPointerClickHandler
{
public GameObject HealthCheck;
public GameObject GYMCheck;
public GameObject EatCheck;
public GameObject SleepCheck;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
//изменяет положение челикса с камерой
if(ChangeRoom.Place == 3){
transform.position = new Vector3(-16.6f,1.3f,-4.2f);
Close_ui_switch_room();
}
if(ChangeRoom.Place == 2){
transform.position = new Vector3(-8.0f,0.7f,-3.79f);
Close_ui_switch_room();
}
if(ChangeRoom.Place == 1){
transform.position = new Vector3(4.5f,1.4f,-4.0f);
Close_ui_switch_room();
}
if(ChangeRoom.Place == 0){
transform.position = new Vector3(0.0f,0.7f,-4.1f);
Close_ui_switch_room();
}
}
//открываю меню
public void OpenUi(float Num){
if (Num == 0){
GYMCheck.SetActive(false);
SleepCheck.SetActive(false);
EatCheck.SetActive(true);
}
if (Num == 1){
EatCheck.SetActive(false);
SleepCheck.SetActive(true);
}
if (Num == 2){
EatCheck.SetActive(false);
GYMCheck.SetActive(true);
HealthCheck.SetActive(false);
}
if (Num == 3){
HealthCheck.SetActive(true);
GYMCheck.SetActive(false);
}
}
//закрывает все окна при переходе на другой экран
public void Close_ui_switch_room(){
GYMCheck.SetActive(false);
SleepCheck.SetActive(false);
EatCheck.SetActive(false);
HealthCheck.SetActive(false);
}
public void OnPointerClick(PointerEventData eventData)
{
OpenUi(ChangeRoom.Place);
}
}
ChangeRoom.Place - это статическая переменная с числом внутри