Beispiel #1
0
 /// <summary>
 /// Load the data.
 /// </summary>
 protected static void Load()
 {
     try
     {
         using (StreamReader reader = new StreamReader(Application.dataPath + Path.DirectorySeparatorChar + RelativeDataPath))
         {
             XmlSerializer serializer = new XmlSerializer(typeof(PlatformerProSettings));
             instance = (PlatformerProSettings)serializer.Deserialize(reader);
         }
     }
     catch (IOException)
     {
         instance = new PlatformerProSettings();
     }
 }
        /// <summary>
        /// Draw the intro window
        /// </summary>
        void OnGUI()
        {
            if (popUpTexture == null)
            {
                popUpTexture = Resources.Load <Texture2D> ("Platformer_TitleScreen");
            }
            GUILayout.Box(popUpTexture, GUILayout.Width(imageWidth), GUILayout.Height(imageWidth * 0.75f));

            bool showOnStartUp = GUILayout.Toggle(PlatformerProSettings.Instance.showTipOnStartUp, "Show this window on project open?");

            if (PlatformerProSettings.Instance.showTipOnStartUp != showOnStartUp)
            {
                PlatformerProSettings.Instance.showTipOnStartUp = showOnStartUp;
                PlatformerProSettings.Save();
            }
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Documentation"))
            {
                Application.OpenURL(DOC_URL);
            }
            if (GUILayout.Button("Tutorials"))
            {
                Application.OpenURL(TUTORIAL_URL);
            }
            if (GUILayout.Button("Support Request"))
            {
                Application.OpenURL(SUPPORT_URL);
            }
            GUILayout.EndHorizontal();


            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(VERSION);
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
        }