示例#1
0
 public static void LoadPluginDataOnStartup()
 {
     I2AboutHelper.StartCheckingForUpdates();
     if (PluginsData == null)
     {
         LoadPluginsData(false);
     }
 }
示例#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() );*/
        }
示例#3
0
 public void OnEnable()
 {
     I2AboutHelper.StartConnection();
 }
示例#4
0
 public void OnEnable()
 {
     LoadPluginsData();
     I2AboutHelper.StartConnection();
 }