private void HideModalWindow() { m_ParentWindow.SetActive(true); e_TypeWinAnim = eTypeAnym.e_HideModalWindow; m_AlfaWin = 0.0f; m_DT = 0.0f; m_ParentWindow.GetComponent <CBaseWindow>().LockInput(); m_ChildWindow.GetComponent <CBaseWindow>().LockInput(); }
private void ShowModalWindow(GameObject parentWin, GameObject childWin) { //m_DrawLineMusic.Stop(); m_ParentWindow = parentWin; m_ChildWindow = childWin; e_TypeWinAnim = eTypeAnym.e_ShowModalWindow; m_AlfaWin = 0.0f; m_DT = 0.0f; m_ChildWindow.SetActive(true); m_ChildWindow.GetComponent <CBaseWindow>().StartShow(); c_pwBase = m_ParentWindow.GetComponent <CAlphaManager>(); c_cwBase = m_ChildWindow.GetComponent <CAlphaManager>(); m_ParentWindow.GetComponent <CBaseWindow>().LockInput(); m_ChildWindow.GetComponent <CBaseWindow>().LockInput(); }
void Start() { m_PlayManager = FindObjectOfType <PlayManager>(); m_Achiv = FindObjectOfType <CAchievements>(); m_ADS = FindObjectOfType <CADS>(); LoadSetup(); _curIndColFon = UnityEngine.Random.Range(0, BackgroundColors.Length); _newIndColFon = _curIndColFon; _backgroundCamera = GetComponent <Camera>(); _backgroundCamera.backgroundColor = BackgroundColors[_curIndColFon]; e_TypeWinAnim = eTypeAnym.e_No; if (m_LocManager == null) { m_LocManager = FindObjectOfType <LocalizationManager>(); } StartCoroutine(m_LocManager.LoadLocalization(langTypeInText[(int)m_Language])); }
private void LateUpdate() { // Если меняем фон окна if (e_TypeColorAnim == eTypeColorAnym.e_SwapColor) { _swapTime += Time.deltaTime; if (_swapTime >= 1.0f) { _swapTime = 1.0f; e_TypeColorAnim = eTypeColorAnym.e_No; _curIndColFon = _newIndColFon; } _backgroundCamera.backgroundColor = Color.Lerp(BackgroundColors[_curIndColFon], BackgroundColors[_newIndColFon], _swapTime); } if (e_TypeWinAnim != eTypeAnym.e_No) { m_DT += Time.deltaTime; m_AlfaWin = m_DT * (1.0f / m_TimeSwapWindow); if (m_DT < m_TimeSwapWindow) { if (e_TypeWinAnim == eTypeAnym.e_ShowModalWindow) { c_pwBase.SetAlpha(1.0f - m_AlfaWin); c_cwBase.SetAlpha(m_AlfaWin); } else { c_pwBase.SetAlpha(m_AlfaWin); c_cwBase.SetAlpha(1.0f - m_AlfaWin); } } else { if (e_TypeWinAnim == eTypeAnym.e_ShowModalWindow) { m_ParentWindow.SetActive(false); m_ChildWindow.SetActive(true); m_ParentWindow.GetComponent <CBaseWindow>().EndHide(); m_ChildWindow.GetComponent <CBaseWindow>().EndShow(); } else { m_ParentWindow.SetActive(true); m_ChildWindow.SetActive(false); m_ParentWindow.GetComponent <CBaseWindow>().EndShow(); m_ParentWindow.GetComponent <CBaseWindow>().EndHide(); } e_TypeWinAnim = eTypeAnym.e_No; m_ParentWindow.GetComponent <CBaseWindow>().UnLockInput(); m_ChildWindow.GetComponent <CBaseWindow>().UnLockInput(); } } else if (Input.GetKeyDown(KeyCode.Escape)) { // Если находимся в стартовом окне if (m_WinStartGame.activeSelf) { m_GUIMusic.Play(); StartCoroutine(CorShowWinGameEnd()); return; } // Если играем if (m_WinGame.activeSelf) { StartCoroutine(CorShowWinPlayExit()); return; } // Если находимся в окне About if (m_WinAbout.activeSelf) { OnPressBtn_HideAboutWnd(); return; } // Если находимся в окне достижений if (m_WinAchievements.activeSelf) { OnPressBtn_HideAchievementsWnd(); return; } // Если находимся в окне настроек if (m_WinSetting.activeSelf) { OnPressBtn_HideSettingWnd(); return; } // Если находимся в окне выхода из игры if (m_WinPlayExit.activeSelf) { OnPressBtn_HidePlayExitWnd(); return; } // Если находимся в окне окончания игры if (m_WinGameOver.activeSelf) { OnPressBtn_GameOver(); return; } // Если находимся в окне помощи if (m_WinHelp.activeSelf) { OnPressBtn_HideHelpWnd(); return; } // Если находимся в окне окончания игры if (m_WinExitOfGame.activeSelf) { m_GUIMusic.Play(); HideModalWindow(); return; } } }