public static void CloseGUI <T>(UImode ui) where T : UImode
 {
     if (ui != null)
     {
         ui.CloseWindow();
     }
 }
Exemple #2
0
 private void Start()
 {
     DieUI.SetActive(false);
     activUImode = UImode.Game;
     SetUIMode(UImode.Game);
     healthSlider.value = 100;
 }
 public static void ShowPreviousUI(UImode current, Action <GameObject> callback)
 {
     if (current == null)
     {
         return;
     }
     current.OpenPreviousWindow();
 }
Exemple #4
0
 /// <summary>
 /// Закрытие не игрового интерфейса
 /// </summary>
 void UIClose()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
     inventoryUI.SetActive(false);
     skillPrograsUI.SetActive(false);
     GameUI.SetActive(true);
     activUImode = UImode.Game;
 }
 public override void Awake()
 {
     base.Default();
     Instance = this;
     SetMyTarget(this.gameObject);
     type        = typeof(UIThree);
     currentMode = this;
     onDestory  += DestoryEvent;
 }
 public override void Awake()
 {
     base.Default();
     Instance = this;
     SetMyTarget(this.gameObject);
     type = typeof(UIThree);
     currentMode = this;
     onDestory += DestoryEvent;
 }
Exemple #7
0
 /// <summary>
 /// Активация интерфейса скилов
 /// </summary>
 void ActivateInterfaceSkillProgras()
 {
     if (!skillPrograsUI.activeSelf)
     {
         UIClose();
         Cursor.lockState = CursorLockMode.None;
         Cursor.visible   = true;
         skillPrograsUI.SetActive(true);
         activUImode = UImode.Skills;
     }
     else
     {
         UIClose();
     }
 }
Exemple #8
0
 /// <summary>
 /// Активация интерфейса инвентаря
 /// </summary>
 void ActivateInterfaceInventory()
 {
     if (!inventoryUI.activeSelf)
     {
         UIClose();
         Cursor.lockState = CursorLockMode.None;
         Cursor.visible   = true;
         inventoryUI.SetActive(true);
         Inventory.instance.UpdateInventory();
         activUImode = UImode.Inventory;
     }
     else
     {
         UIClose();
     }
 }
 public static void ShowGUI <T>(UImode ui, string name) where T : UImode
 {
     if (ui == null)
     {
         SceneManager.instance.LoadSceneGUI("GUI/" + name);
         Utility.StartSceneCoroutine <float, Action>(Utility.instance.Wait, 0.01f, () =>
         {
             ((UImode)typeof(T).GetField("Instance").GetValue(null)).OpenWindow();
         });
     }
     else
     {
         ui.OpenWindow();
     }
     ResetAllCacheDepth();
 }
Exemple #10
0
    /// <summary>
    /// Установка режима UI
    /// </summary>
    /// <param name="mode"></param>
    public void SetUIMode(UImode mode)
    {
        switch (mode)
        {
        case UImode.Game:
            UIClose();
            break;

        case UImode.Inventory:
            ActivateInterfaceInventory();
            break;

        case UImode.Skills:
            ActivateInterfaceSkillProgras();
            break;
        }
    }
Exemple #11
0
 public virtual void Awake()
 {
     instance = this;
 }