Esempio n. 1
0
        // ======== SL Setup ========

        internal static void Setup(bool isFirstSetup = true)
        {
            var start = Time.realtimeSinceStartup;

            if (isFirstSetup)
            {
                CloneHolder = new GameObject("SL_CloneHolder").transform;
                GameObject.DontDestroyOnLoad(CloneHolder.gameObject);
                CloneHolder.hideFlags |= HideFlags.HideAndDontSave;
                CloneHolder.gameObject.SetActive(false);

                SLRPCManager.Setup();

                PlayerSaveExtension.LoadExtensionTypes();

                CheckPrefabDictionaries();

                TryInvoke(BeforePacksLoaded);
            }
            else
            {
                ResetForHotReload();
            }

            // Load SL Packs
            SLPackManager.LoadAllPacks(isFirstSetup);

            if (isFirstSetup)
            {
                foreach (var pack in SL.s_packs)
                {
                    pack.Value.TryApplyItemTextureBundles();
                }
            }

            // Invoke OnPacksLoaded and cleanup
            PacksLoaded = true;
            Log("SideLoader Setup Finished");
            Log("-------------------------");

            SL.Log("SL Setup took " + (Time.realtimeSinceStartup - start) + " seconds");

            if (isFirstSetup)
            {
                if (OnPacksLoaded != null)
                {
                    TryInvoke(OnPacksLoaded);
                    Log("Finished invoking OnPacksLoaded.");
                }

                /* Setup UI */
                UIManager.Init();
            }
        }
Esempio n. 2
0
 public static void Postfix(Character _character)
 {
     try
     {
         PlayerSaveExtension.LoadExtensions(_character);
     }
     catch (Exception ex)
     {
         SL.LogWarning("Exception on loading SL PlayerSaveExtensions!");
         SL.LogInnerException(ex);
     }
 }