Esempio n. 1
0
 /// <summary>
 ///     Called when an addon has been loaded.
 /// </summary>
 private static void OnAddonLoadComplete(Addon addon)
 {
     if (addon != null)
     {
         Debug.Log(addon);
         LoadedAddons.Add(addon);
     }
     LoadingCount = LoadingCount - 1;
 }
Esempio n. 2
0
        /// <summary>
        ///     Loads or reloads all of the AVC add-ons.
        /// </summary>
        public static void LoadAddons()
        {
            // Check that loading is not currently in progress.
            if (IsLoading)
            {
                return;
            }

            // Clear the current list of loaded add-ons.
            LoadedAddons.Clear();
            LoadingCount = 0;

            // Get an array of all the .version file paths and a count of how many there are.
            string[] addonFilePaths = Directory.GetFiles(GameDataPath, "*.version", SearchOption.AllDirectories);
            int      addonFileCount = addonFilePaths.Length;

            // Iterate over all the add-on file paths to start loading them.
            for (int i = 0; i < addonFileCount; ++i)
            {
                LoadAvcAddonFromFile(addonFilePaths[i]);
            }
        }