1234567891011121314151617181920212223242526272829303132333435 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace KairoEngine.UI
- {
- public class ModalWindowController : MonoBehaviour, IUiSystemElement
- {
- public string elementName = "NewModalWindow";
- public Canvas canvas;
- private bool isVisible = false;
- private void Start()
- {
- UiManager.RegisterElement(elementName, this, this.transform, false);
- }
- public void Hide()
- {
- isVisible = false;
- canvas.gameObject.SetActive(false);
- }
- public void Show()
- {
- isVisible = true;
- canvas.gameObject.SetActive(true);
- }
- public bool IsVisible() => isVisible;
- private void OnEnable() => UiManager.RegisterElement(elementName, this, this.transform, isVisible);
- private void OnDisable() => UiManager.UnregisterElement(this);
- }
- }
|