예제 #1
0
 public static bool Load(UnityModManager.ModEntry modEntry)
 {
     mod     = modEntry;
     setting = UnityModManager.ModSettings.Load <ModSetting>(mod);
     HarmonyInstance.Create(modEntry.Info.Id).PatchAll(Assembly.GetExecutingAssembly());
     mod.OnGUI            = OnGUI;
     mod.OnSaveGUI        = OnSaveGUI;
     mod.OnHideGUI        = OnSaveGUI;
     mod.Info.DisplayName = "视频电视 (本人所有mod均在群内免费发布,未授权任何二次售卖)";
     return(true);
 }
예제 #2
0
        public static bool Load(UnityModManager.ModEntry modEntry)
        {
            setting = UnityModManager.ModSettings.Load <ModSetting>(modEntry);
            logger  = modEntry.Logger;
            HarmonyInstance.Create(modEntry.Info.Id).PatchAll(Assembly.GetExecutingAssembly());

            AssetBundle ab = AssetBundle.LoadFromMemory(File.ReadAllBytes("Mods/VideoTV/Resources/xy.tvscreen"));

            screenPrefab = ab.LoadAsset <GameObject>("TVVideoPlayer");
            ab.Unload(false);
            if (setting.videoUrlList.Count <= 0)
            {
                setting.videoUrlList.Add(modEntry.Path + "Resources\\Video.mp4");
            }
            else
            {
                setting.videoUrlList[0] = modEntry.Path + "Resources\\Video.mp4";
            }

            modEntry.OnGUI     = OnGUI;
            modEntry.OnSaveGUI = OnSaveGUI;
            modEntry.OnHideGUI = OnHideGUI;
            return(true);
        }