public void LoadAsset(IServiceKernel kernel, Mod mod, string path) { // If the config has disabled loading the default included levels, return if (!Entrypoint.LoadDebugLevels.Value && mod.Info.Guid == "wurstmod") { return; } // Make sure it's a directory if (!path.EndsWith("/")) { path += "/"; } // Try to make a level info from it var level = LevelInfo.FromFrameworkMod(mod, path); if (!level.HasValue) { Debug.LogError($"Level in {mod}, {path} is not valid!"); } else { CustomLevelFinder.ArchiveLevels.Add(level.Value); Debug.Log($"Discovered level {level.Value.SceneName} in {mod}, {path}"); } }
public void LoadAsset(IServiceKernel kernel, Mod mod, string path) { // We the asset as an ExampleAsset using the asset reader defined in another file var asset = mod.Resources.Get <ExampleJsonAsset>(path).Unwrap(); // Switch on the severity and log the message from the logger of the mod that contains the asset mod.Logger.LogInfo(asset.Message); }
public void LoadAsset(IServiceKernel kernel, Mod mod, string path) { if (Path.GetExtension(path) == "manifest") { // We don't care for these files, but the glob will match these files anyway. return; } var bundle = mod.Resources.Get <AssetBundle>(path).Expect("Asset bundle not found at " + path); var id = mod.Info.Guid + ":" + path; _bundles.Add(id, bundle); }