Ejemplo n.º 1
0
        public static void ShowWindow(WelcomeState state)
        {
            var window = GetWindow <WelcomeWindow>(true, Title, true);

            window.minSize      = WindowSize;
            window.maxSize      = WindowSize;
            window.titleContent = new GUIContent(Title);

            window.State = state;

            window.position = new Rect(150, 150, WindowWidth, WindowHeight);
            window.Repaint();
        }
Ejemplo n.º 2
0
 private static void SetWelcomeState([CanBeNull] WelcomeState state)
 {
     if (state == null)
     {
         //Clear installer state
         File.Delete(StatePath);
     }
     else
     {
         using (var writer = File.CreateText(StatePath))
             writer.Write(JsonUtility.ToJson(state));
     }
 }
Ejemplo n.º 3
0
 [NotNull] private static WelcomeState GetWelcomeState()
 {
     if (!File.Exists(StatePath))
     {
         // State path does not exist at all so create the default
         var state = new WelcomeState("");
         SetWelcomeState(state);
         return(state);
     }
     else
     {
         //Read the state from the file
         using (var reader = File.OpenText(StatePath))
             return(JsonUtility.FromJson <WelcomeState>(reader.ReadToEnd()));
     }
 }
Ejemplo n.º 4
0
        public static void ShowWindow(WelcomeState state, bool showRateLink)
        {
            var window = GetWindow <WelcomeWindow>(true, Title, true);

            var size = WindowSize + new Vector2(0, showRateLink ? 22 : 0);

            window.minSize      = size;
            window.maxSize      = size;
            window.titleContent = new GUIContent(Title);

            window.State          = state;
            window.ShowRatingLink = showRateLink;

            window.position = new Rect(150, 150, size.x, size.y);
            window.Repaint();
        }