Пример #1
0
 internal 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));
     }
 }
Пример #2
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();
        }
Пример #3
0
 internal 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()));
     }
 }