Exemple #1
0
 public static void LoadPluginDataOnStartup()
 {
     I2AboutHelper.StartCheckingForUpdates();
     if (PluginsData == null)
     {
         LoadPluginsData(false);
     }
 }
Exemple #2
0
        public static void LoadPluginsData(bool loadImages = true)
        {
            string dataXML = /*string.Empty;*/ DownloadedData;

            if (string.IsNullOrEmpty(dataXML))
            {
                LoadDefaultData();
            }
            else
            {
                I2AboutHelper.DeserializeData(dataXML);

                if (PluginsData == null)
                {
                    LoadDefaultData();
                }
            }

            if (!loadImages)
            {
                return;
            }

            ImagePreviewDictionary.Clear();
            for (int i = 0; i < PluginsData.Plugins.Length; ++i)
            {
                PluginData data = PluginsData.Plugins[i];
                ImagePreviewDictionary.Add(data.Name + "_Preview1", Resources.Load <Texture2D>(data.Name + "_Preview1"));
                ImagePreviewDictionary.Add(data.Name + "_Preview2", Resources.Load <Texture2D>(data.Name + "_Preview2"));
                ImagePreviewDictionary.Add(data.Name + "_Preview3", Resources.Load <Texture2D>(data.Name + "_Preview3"));
            }

            for (int i = 0; i < PluginsData.Assets.Length; ++i)
            {
                ImagePreviewDictionary.Add("I2 Assets " + PluginsData.Assets[i].Name, Resources.Load <Texture2D>("I2 Assets " + PluginsData.Assets[i].Name));
            }
            for (int i = 0; i < PluginsData.Games.Length; ++i)
            {
                ImagePreviewDictionary.Add("I2 Games " + PluginsData.Games[i].Name, Resources.Load <Texture2D>("I2 Games " + PluginsData.Games[i].Name));
            }

            /*System.IO.StringWriter writer = new System.IO.StringWriter(System.Globalization.CultureInfo.InvariantCulture);
             *          System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer( typeof(PluginsManagerData) );
             *          serializer.Serialize( writer, PluginsData );
             *          Debug.Log ( writer.ToString() );*/
        }
Exemple #3
0
 public void OnEnable()
 {
     I2AboutHelper.StartConnection();
 }
Exemple #4
0
 public void OnEnable()
 {
     LoadPluginsData();
     I2AboutHelper.StartConnection();
 }