Beispiel #1
0
        /// <summary>
        /// Called before GameContext.Start()
        /// </summary>
        static void Load()
        {
            if (isInitialized)
            {
                return;
            }
            isInitialized = true;

            BaseObjects.Populate();
            SRCallbacks.OnLoad();
            PrefabUtils.ProcessReplacements();
            KeyBindManager.ReadBinds();
            GameContext.Instance.gameObject.AddComponent <ModManager>();
            GameContext.Instance.gameObject.AddComponent <KeyBindManager.ProcessAllBindings>();
            try
            {
                SRModLoader.LoadMods();
            }
            catch (Exception e)
            {
                Debug.LogError(e);
                ErrorGUI.CreateError($"{e.GetType().Name}: {e.Message}");
                return;
            }
            PostLoad();
        }
Beispiel #2
0
 static void PostLoad()
 {
     if (isPostInitialized)
     {
         return;
     }
     isPostInitialized = true;
     PrefabUtils.ProcessReplacements();
     try
     {
         SRModLoader.PostLoadMods();
     }
     catch (Exception e)
     {
         ErrorGUI.CreateError($"{e.GetType().Name}: {e.Message}");
         return;
     }
 }