public static void Open()
 {
     if (Instance == null)
     {
         Instance = UIView.GetAView().AddUIComponent(typeof(UISaveWindow)) as UISaveWindow;
         UIView.PushModal(Instance);
     }
 }
Example #2
0
 private void SaveLoadButtonOnEventClicked(UIComponent component, UIMouseEventParameter eventparam)
 {
     if (UISaveWindow.Instance != null)
     {
         UISaveWindow.Export(_fileNameLabel.text);
     }
     else
     {
         UILoadWindow.Close();
         PresetsUtils.Import(_fileNameLabel.text);
     }
 }
        public static void Close()
        {
            if (Instance != null)
            {
                UIView.PopModal();

                var modalEffect = Instance.GetUIView().panelsLibraryModalEffect;
                if (modalEffect != null && modalEffect.isVisible)
                {
                    ValueAnimator.Animate("ModalEffect", delegate(float val) { modalEffect.opacity = val; },
                                          new AnimatedFloat(1f, 0f, 0.7f, EasingType.CubicEaseOut), delegate { modalEffect.Hide(); });
                }

                Instance.isVisible = false;
                Instance.UnsubscribeFromUiEvents();
                Destroy(Instance.gameObject);
                Instance = null;
            }
        }
        private void SavePresetsButtonOnClicked(UIComponent component, UIMouseEventParameter parameter)
        {
            Log._Debug($"[{nameof(UIMainWindow)}.{nameof(SavePresetsButtonOnClicked)}] Event triggered with parameter: {parameter}");

            UISaveWindow.Open();
        }