Exemple #1
0
        void Awake()
        {
            VRCModLogger.Log("[ModComponent] Awake called");
            DontDestroyOnLoad(gameObject);
            Instance = this;

            try
            {
                ModManager.LoadMods();
            }
            catch (Exception e)
            {
                VRCModLogger.Log("An error occured while loading mods: " + e);
            }

            mods = new CompositeModCaller(ModManager.ModControllers);
            mods.OnApplicationStart();

            SceneManager.sceneLoaded += (scene, method) =>
            {
                VRCModLogger.Log("[ModComponent] Scene Loaded: " + scene.name);

                if (scene.name == "ui")
                {
                    StartCoroutine(StartVRModules());
                }

                mods.OnLevelWasLoaded(scene.buildIndex);
            };
        }
Exemple #2
0
 void OnLevelWasLoaded(int level)
 {
     VRCModLogger.Log("[ModComponent] OnLevelWasLoaded called (" + level + ")");
     transform.SetAsLastSibling();
     if (mods != null)
     {
         mods.OnLevelWasLoaded(level);
     }
     freshlyLoaded = true;
 }
Exemple #3
0
 void OnLevelWasLoaded(int level)
 {
     VRCModLogger.Log("[ModComponent] OnLevelWasLoaded called (" + level + ")");
     if (level == 0)
     {
         StartCoroutine(VRCToolsUpdater.UpdateAndRebootIfRequired());
     }
     if (mods != null)
     {
         mods.OnLevelWasLoaded(level);
     }
     freshlyLoaded = true;
 }