public bool GetPrefabs() { try { QuickLogger.Debug($"AssetBundle Set"); QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>(Mod.ClassID); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(prefab, assetBundle); QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } GameObject colorItem = QPatch.GlobalBundle.LoadAsset <GameObject>("ColorItem"); if (colorItem != null) { ColorItemPrefab = colorItem; } else { QuickLogger.Error($"Color Item Not Found!"); return(false); } GameObject itemPrefab = assetBundle.LoadAsset <GameObject>("BaseTeleportItem"); if (itemPrefab != null) { ItemPrefab = itemPrefab; QuickLogger.Debug($"Teleport Item Prefab Found!"); } else { QuickLogger.Error($"Teleport Item Prefab Not Found!"); return(false); } return(true); } catch (Exception e) { QuickLogger.Error <QuantumTeleporterBuildable>(e.Message); return(false); } }
/// <summary> /// Gets the prefabs from the bundle /// </summary> /// <returns></returns> private bool GetPrefabs() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>("FireExtinguisherHolder"); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { ApplyShaders(prefab, assetBundle); _prefab = prefab; QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } return(true); }
/// <summary> /// Finds the prefab in the asset bundle /// </summary> /// <returns></returns> public bool GetPrefabs() { // == Get the prefab == // AssetBundle assetBundle = AssetHelper.Asset("CyclopsNuclearReactor", "CyNukReactorbundle"); //If the result is null return false. if (assetBundle == null) { return(false); } _assetBundle = assetBundle; //We have found the asset bundle and now we are going to continue by looking for the model. GameObject cyNukReactorPrefab = assetBundle.LoadAsset <GameObject>("CyNukReactor"); //If the prefab isn't null lets add the shader to the materials if (cyNukReactorPrefab != null) { _cyNukReactorPrefab = cyNukReactorPrefab; //Lets apply the material shader ApplyShaders(_cyNukReactorPrefab); } else { return(false); } return(true); }
public bool GetPrefabs() { try { QuickLogger.Debug($"AssetBundle Set"); QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModName, Mod.BundleName); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>(Mod.PrefabName); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(prefab, assetBundle); QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } return(true); } catch (Exception e) { QuickLogger.Error <FCSDemoBuidable>(e.Message); return(false); } }
private bool GetPrefabs() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } _assetBundle = assetBundle; QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>(Mod.GameObjectName); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(prefab); QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } //We have found the asset bundle and now we are going to continue by looking for the model. GameObject listItem = assetBundle.LoadAsset <GameObject>("ItemSlot"); //If the prefab isn't null lets add the shader to the materials if (listItem != null) { ItemPrefab = listItem; QuickLogger.Debug("List item Prefab Found!"); } else { QuickLogger.Error("List item Prefab Not Found!"); return(false); } return(true); }
public bool GetPrefabs() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset($"{Information.ModFolderName}", "fcspowerstorage-mod"); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } AssetBundle = assetBundle; QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>(Information.PrefrabName); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(prefab); QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } //We have found the asset bundle and now we are going to continue by looking for the model. GameObject colorItem = assetBundle.LoadAsset <GameObject>("ColorItem"); //If the prefab isn't null lets add the shader to the materials if (colorItem != null) { ColorItemPefab = colorItem; QuickLogger.Debug($"ColorItem Prefab Found!"); } else { QuickLogger.Error($"ColorItem Prefab Not Found!"); return(false); } return(true); }
private static void LoadAssetBundle() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset($"FCS_MarineTurbine", "aimarineturbinemodbundle"); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); throw new FileLoadException(); } Bundle = assetBundle; }
private static void AddTechFabricatorItems() { if (AssetBundle == null) { QuickLogger.Debug("GetPrefabs"); AssetBundle = AssetHelper.Asset(Mod.ModName, Mod.BundleName); } var icon = ImageUtils.LoadSpriteFromFile(Path.Combine(Mod.GetAssetFolder(), $"{Mod.ModClassName}.png")); var craftingTab = new CraftingTab(Mod.ModTabID, Mod.ModFriendlyName, icon); var cucKit = new FCSKit(Mod.CyclopsUpgradeConsoleKitClassID, Mod.ModFriendlyName, craftingTab, Mod.CyclopsUpgradeConsoleIngredients); cucKit.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI); }
public static bool GetPrefabs() { try { if (!_initialized) { QuickLogger.Debug($"AssetBundle Set"); QuickLogger.Debug("GetPrefabs"); _assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); Bundle = _assetBundle; //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = _assetBundle.LoadAsset <GameObject>(Mod.ModPrefabName); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { //Lets apply the material shader ApplyShaders(prefab, _assetBundle); Prefab = prefab; QuickLogger.Debug($"{Mod.ModFriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{Mod.ModFriendlyName} Gen Prefab Not Found!"); return(false); } _initialized = true; } return(true); } catch (Exception e) { QuickLogger.Error(e.Message); return(false); } }
public static GameObject GetPrefabs(string prefabName) { try { QuickLogger.Info($"Trying to find prefab ID: {prefabName}"); if (!_init) { QuickLogger.Debug($"AssetBundle Set"); QuickLogger.Debug("GetPrefabs"); _assetBundle = AssetHelper.Asset(Mod.ModName, Mod.BundleName); _init = true; } //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = _assetBundle?.LoadAsset <GameObject>(prefabName); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { //Lets apply the material shader ApplyShaders(prefab, _assetBundle); QuickLogger.Debug($"{prefabName} Found!"); return(prefab); } else { QuickLogger.Error($"{prefabName} Not Found!"); return(null); } } catch (Exception e) { QuickLogger.Error <FCSDemoBuidable>(e.Message); return(null); } }
private static void AddTechFabricatorItems() { if (AssetBundle == null) { QuickLogger.Debug("GetPrefabs"); AssetBundle = AssetHelper.Asset(Mod.ModName, Mod.BundleName); } var icon = ImageUtils.LoadSpriteFromFile(Path.Combine(Mod.GetAssetFolder(), $"{Mod.ClassID}.png")); var craftingTab = new CraftingTab(Mod.SeaCookerTabID, Mod.FriendlyName, icon); var seaCookerKit = new FCSKit(Mod.SeaCookerKitClassID, Mod.FriendlyName, craftingTab, Mod.SeaCookerIngredients); seaCookerKit.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI); var seaAlienGasTank = new SeaAlienGasTankCraftable(Mod.SeaAlienGasClassID, Mod.SeaAlienGasFriendlyName, Mod.SeaAlienGasDescription, craftingTab); seaAlienGasTank.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI); var seaGasTank = new SeaGasTankCraftable(Mod.SeaGasClassID, Mod.SeaGasFriendlyName, Mod.SeaGasDescription, craftingTab); seaGasTank.Patch(FcTechFabricatorService.PublicAPI, FcAssetBundlesService.PublicAPI); }
private bool GetPrefabs() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset("HorizontalDuck", "horizontalduckmodbundle"); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } _assetBundle = assetBundle; QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>("HorizontalDuck"); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(prefab); QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } return(true); }
public bool GetPrefabs() { MCUServices.Logger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset("CyclopsBioReactor", "cyclopsbioreactormodbundle"); //If the result is null return false. if (assetBundle == null) { MCUServices.Logger.Error($"AssetBundle is Null!"); return(false); } _assetBundle = assetBundle; MCUServices.Logger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>("CyclopsBioreactor"); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(_prefab); MCUServices.Logger.Debug($"{this.FriendlyName} Prefab Found!"); } else { MCUServices.Logger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } return(true); }
private bool GetPrefabs() { // == Get the prefab == // AssetBundle assetBundle = AssetHelper.Asset("IonCubeGenerator", "ioncubegeneratorbundle"); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } _assetBundle = assetBundle; QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject ionCubeGenPrefab = assetBundle.LoadAsset <GameObject>("IonCubeGenerator"); //If the prefab isn't null lets add the shader to the materials if (ionCubeGenPrefab != null) { _ionCubeGenPrefab = ionCubeGenPrefab; //Lets apply the material shader ApplyShaders(_ionCubeGenPrefab); QuickLogger.Debug($"IonCubeGen Prefab Found!"); } else { QuickLogger.Error($"IonCubeGen Prefab Not Found!"); return(false); } return(true); }
private bool GetPrefabs() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } AssetBundle = assetBundle; QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>("AlterraDeepDriller"); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { //Lets apply the material shader ApplyShaders(prefab); _prefab = prefab; QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } //We have found the asset bundle and now we are going to continue by looking for the model. GameObject itemButton = assetBundle.LoadAsset <GameObject>("ItemButton"); //If the prefab isn't null lets add the shader to the materials if (itemButton != null) { ItemPrefab = itemButton; QuickLogger.Debug("Item Button Prefab Found!"); } else { QuickLogger.Error("Item Button Prefab Not Found!"); return(false); } //We have found the asset bundle and now we are going to continue by looking for the model. GameObject programmingItemButton = assetBundle.LoadAsset <GameObject>("ProgrammingItem"); //If the prefab isn't null lets add the shader to the materials if (programmingItemButton != null) { ProgrammingItemPrefab = programmingItemButton; QuickLogger.Debug("Programming Item Button Prefab Found!"); } else { QuickLogger.Error("Programming Item Button Prefab Not Found!"); return(false); } GameObject listItemButton = assetBundle.LoadAsset <GameObject>("TransferToggleButton"); if (listItemButton != null) { ListItemPrefab = listItemButton; QuickLogger.Debug("List Item Button Prefab Found!"); } else { QuickLogger.Error("Item Button Prefab Not Found!"); return(false); } GameObject colorItem = QPatch.GlobalBundle.LoadAsset <GameObject>("ColorItem"); if (colorItem != null) { ColorItemPrefab = colorItem; } else { QuickLogger.Error($"Color Item Not Found!"); return(false); } return(true); }
/// <summary> /// Gets the prefabs from the bundle /// </summary> /// <returns></returns> internal static bool GetPrefabs() { if (!_initialized) { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>(Mod.ModName); GameObject screenPrefab = assetBundle.LoadAsset <GameObject>(Mod.ModScreenName); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { ApplyShaders(prefab, assetBundle); OxstationPrefab = prefab; QuickLogger.Debug($"Oxstation Prefab Found!"); } else { QuickLogger.Error($"Oxstation Prefab Not Found!"); return(false); } //If the prefab isn't null lets add the shader to the materials if (screenPrefab != null) { ApplyShaders(screenPrefab, assetBundle); OxstationScreenPrefab = screenPrefab; QuickLogger.Debug($"Oxstation Screen Prefab Found!"); } else { QuickLogger.Error($"Oxstation Screen Prefab Not Found!"); return(false); } GameObject item = assetBundle.LoadAsset <GameObject>("OxStation_Item"); if (item != null) { ItemPrefab = item; } else { QuickLogger.Error($"OxStation_Item Not Found!"); return(false); } _initialized = true; } return(true); }
public static bool GetPrefabs() { try { if (!_initialized) { QuickLogger.Debug($"AssetBundle Set"); QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); Bundle = assetBundle; //We have found the asset bundle and now we are going to continue by looking for the model. GameObject wallMountRackPrefab = assetBundle.LoadAsset <GameObject>(Mod.WallMountedRackPrefabName); GameObject floorMountRackPrefab = assetBundle.LoadAsset <GameObject>(Mod.FloorMountedRackPrefabName); GameObject terminalPrefab = assetBundle.LoadAsset <GameObject>(Mod.TerminalPrefabName); GameObject colorItem = QPatch.GlobalBundle.LoadAsset <GameObject>("ColorItem"); GameObject serverModel = assetBundle.LoadAsset <GameObject>(Mod.ServerPrefabName); GameObject baseItem = assetBundle.LoadAsset <GameObject>("DSS_Base_Item"); GameObject vehicleItem = assetBundle.LoadAsset <GameObject>("DSS_Vehicle_Item"); GameObject item = assetBundle.LoadAsset <GameObject>("DSS_Item"); GameObject antenna = assetBundle.LoadAsset <GameObject>(Mod.AntennaPrefabName); GameObject formatMachine = assetBundle.LoadAsset <GameObject>(Mod.ServerFormattingStationPrefabName); GameObject filterItemPrefab = assetBundle.LoadAsset <GameObject>("FilterItem"); //If the prefab isn't null lets add the shader to the materials if (wallMountRackPrefab != null) { //Lets apply the material shader ApplyShaders(wallMountRackPrefab, assetBundle); WallMountRackPrefab = wallMountRackPrefab; QuickLogger.Debug($"Wall Mount Rack Prefab Found!"); } else { QuickLogger.Error($"Wall Mount Rack Prefab Not Found!"); return(false); } //Floor Mounted Rack Has Been Cut //if (floorMountRackPrefab != null) //{ // //Lets apply the material shader // ApplyShaders(floorMountRackPrefab, assetBundle); // FloorMountRackPrefab = floorMountRackPrefab; // QuickLogger.Debug($"Floor Mount Rack Prefab Found!"); //} //else //{ // QuickLogger.Error($"Floor Mount Rack Prefab Not Found!"); // return false; //} if (terminalPrefab != null) { //Lets apply the material shader ApplyShaders(terminalPrefab, assetBundle); TerminalPrefab = terminalPrefab; QuickLogger.Debug($"Terminal Prefab Found!"); } else { QuickLogger.Error($"Terminal Prefab Not Found!"); return(false); } if (colorItem != null) { ColorItemPrefab = colorItem; } else { QuickLogger.Error($"Color Item Not Found!"); return(false); } if (serverModel != null) { ApplyShaders(serverModel, assetBundle); ServerPrefab = serverModel; } else { QuickLogger.Error($"HydroponicHarvesterBottleModel Not Found!"); return(false); } if (baseItem != null) { BaseItemPrefab = baseItem; } else { QuickLogger.Error($"DSS_Base_Item Not Found!"); return(false); } if (vehicleItem != null) { VehicleItemPrefab = vehicleItem; } else { QuickLogger.Error($"DSS_Vehicle_Item Not Found!"); return(false); } if (item != null) { ItemPrefab = item; } else { QuickLogger.Error($"DSS_Item Not Found!"); return(false); } if (antenna != null) { ApplyShaders(antenna, assetBundle); AntennaPrefab = antenna; } else { QuickLogger.Error($"Antenna Not Found!"); return(false); } if (formatMachine != null) { ApplyShaders(formatMachine, assetBundle); ServerFormatStationPrefab = formatMachine; } else { QuickLogger.Error($"Format Machine Not Found!"); return(false); } if (filterItemPrefab != null) { FilterItemPrefab = filterItemPrefab; } else { QuickLogger.Error($"Filter Item Not Found!"); return(false); } _initialized = true; } return(true); } catch (Exception e) { QuickLogger.Error <DSSModelPrefab>(e.Message); return(false); } }
public static bool GetPrefabs() { try { if (!_initialized) { QuickLogger.Debug($"AssetBundle Set"); QuickLogger.Debug("GetPrefabs"); _assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); Bundle = _assetBundle; //We have found the asset bundle and now we are going to continue by looking for the model. GameObject lPrefab = _assetBundle.LoadAsset <GameObject>(Mod.LargePrefabName); GameObject mPrefab = _assetBundle.LoadAsset <GameObject>(Mod.MediumPrefabName); GameObject sPrefab = _assetBundle.LoadAsset <GameObject>(Mod.SmallPrefabName); //If the prefab isn't null lets add the shader to the materials if (lPrefab != null) { //Lets apply the material shader ApplyShaders(lPrefab, _assetBundle); LargePrefab = lPrefab; QuickLogger.Debug($"Large Prefab Found!"); } else { QuickLogger.Error($"Large Prefab Not Found!"); return(false); } if (mPrefab != null) { //Lets apply the material shader ApplyShaders(mPrefab, _assetBundle); MediumPrefab = mPrefab; QuickLogger.Debug($"Medium Prefab Found!"); } else { QuickLogger.Error($"Medium Prefab Not Found!"); return(false); } if (sPrefab != null) { //Lets apply the material shader ApplyShaders(sPrefab, _assetBundle); SmallPrefab = sPrefab; QuickLogger.Debug($"Small Prefab Found!"); } else { QuickLogger.Error($"Small Prefab Not Found!"); return(false); } GameObject colorItem = QPatch.GlobalBundle.LoadAsset <GameObject>("ColorItem"); if (colorItem != null) { ColorItemPrefab = colorItem; } else { QuickLogger.Error($"Color Item Not Found!"); return(false); } GameObject bottleModel = _assetBundle.LoadAsset <GameObject>("HydroponicHarvesterBottleModel"); if (bottleModel != null) { ApplyShaders(bottleModel, _assetBundle); BottlePrefab = bottleModel; } else { QuickLogger.Error($"HydroponicHarvesterBottleModel Not Found!"); return(false); } GameObject item = _assetBundle.LoadAsset <GameObject>("HydroHarvItem"); if (item != null) { ItemPrefab = item; } else { QuickLogger.Error($"HydroHarvItem Not Found!"); return(false); } _initialized = true; } return(true); } catch (Exception e) { QuickLogger.Error <HydroponicHarvestersBuildable>(e.Message); return(false); } }
private bool GetPrefabs() { QuickLogger.Debug("GetPrefabs"); AssetBundle assetBundle = AssetHelper.Asset(Mod.ModFolderName, Mod.BundleName); //If the result is null return false. if (assetBundle == null) { QuickLogger.Error($"AssetBundle is Null!"); return(false); } AssetBundle = assetBundle; QuickLogger.Debug($"AssetBundle Set"); //We have found the asset bundle and now we are going to continue by looking for the model. GameObject prefab = assetBundle.LoadAsset <GameObject>("AlterraDeepDriller"); //If the prefab isn't null lets add the shader to the materials if (prefab != null) { _prefab = prefab; //Lets apply the material shader ApplyShaders(prefab); QuickLogger.Debug($"{this.FriendlyName} Prefab Found!"); } else { QuickLogger.Error($"{this.FriendlyName} Prefab Not Found!"); return(false); } //We have found the asset bundle and now we are going to continue by looking for the model. GameObject listItem = assetBundle.LoadAsset <GameObject>("ListButton"); //If the prefab isn't null lets add the shader to the materials if (listItem != null) { ItemPrefab = listItem; QuickLogger.Debug("List item Prefab Found!"); } else { QuickLogger.Error("List item Prefab Not Found!"); return(false); } #region Battery Module //We have found the asset bundle and now we are going to continue by looking for the model. GameObject batteryModule = assetBundle.LoadAsset <GameObject>("Battery_Attachment"); //If the prefab isn't null lets add the shader to the materials if (batteryModule != null) { ApplyShaders(batteryModule); BatteryModule = batteryModule; QuickLogger.Debug($"Battery Module Prefab Found!"); } else { QuickLogger.Error($"Battery Module Prefab Not Found!"); return(false); } #endregion #region Solar Module //We have found the asset bundle and now we are going to continue by looking for the model. GameObject solarModule = assetBundle.LoadAsset <GameObject>("Solar_Panel_Attachment"); //If the prefab isn't null lets add the shader to the materials if (solarModule != null) { ApplyShaders(solarModule); SolarModule = solarModule; QuickLogger.Debug($"Solar Module Prefab Found!"); } else { QuickLogger.Error($"Solar Module Prefab Not Found!"); return(false); } #endregion #region Focus Module //We have found the asset bundle and now we are going to continue by looking for the model. GameObject focusModule = assetBundle.LoadAsset <GameObject>("Scanner_Screen_Attachment"); //If the prefab isn't null lets add the shader to the materials if (focusModule != null) { ApplyShaders(focusModule); FocusModule = focusModule; QuickLogger.Debug($"Focus Module Prefab Found!"); } else { QuickLogger.Error($"Solar Module Prefab Not Found!"); return(false); } #endregion return(true); }
/// <summary> /// Loads the prefabs from the asset bundle /// </summary> /// <returns></returns> private static bool GetPrefabs() { var myLoadedAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "globalmaterials")); if (myLoadedAssetBundle != null) { GlobalBundle = myLoadedAssetBundle; } else { return(false); } var assetBundle = AssetHelper.Asset(Information.ModName, Information.ModBundleName); if (assetBundle != null) { ASSETBUNDLE = assetBundle; } else { return(false); } var aiSolutionsJetStreamPrefab = ASSETBUNDLE.LoadAsset <GameObject>(Information.ModBundleRoot).FindChild(Information.JetStreamTurbineGameObjectName); if (aiSolutionsJetStreamPrefab != null) { JetStreamT242Prefab = aiSolutionsJetStreamPrefab; } else { return(false); } var marineTurbinesMonitorPrefab = ASSETBUNDLE.LoadAsset <GameObject>(Information.ModBundleRoot).FindChild(Information.MarineTurbinesMonitorGameObjectName); if (marineTurbinesMonitorPrefab != null) { MarineTurbinesMonitorPrefab = marineTurbinesMonitorPrefab; } else { return(false); } var deepDrillerPrefab = ASSETBUNDLE.LoadAsset <GameObject>(Information.ModBundleRoot).FindChild(Information.DeepDrillerGameObjectName); if (deepDrillerPrefab != null) { Log.Info("Found Driller Prefab"); DeepDrillerPrefab = deepDrillerPrefab; } else { return(false); } var turbineItemPrefab = ASSETBUNDLE.LoadAsset <GameObject>("TurbineItem"); if (turbineItemPrefab != null) { Log.Info("Found TurbineItem Prefab"); TurbineItemPrefab = turbineItemPrefab; } else { return(false); } //Resources.Load<GameObject>("Submarine/Build/PowerTransmitter"); var xPowerConnectionPrefab = ASSETBUNDLE.LoadAsset <GameObject>("xPowerConnection"); if (xPowerConnectionPrefab != null) { Log.Info("Found xPowerConnection Prefab"); XPowerConnectionPrefab = xPowerConnectionPrefab; var lineRenderer = XPowerConnectionPrefab.AddComponent <LineRenderer>(); lineRenderer.textureMode = LineTextureMode.Stretch; lineRenderer.material = MaterialHelpers.FindMaterial("FCSLineRender", ASSETBUNDLE); lineRenderer.startColor = new Color(0.08235294f, 1f, 1f); lineRenderer.endColor = new Color(0.08235294f, 1f, 1f); lineRenderer.startWidth = 0.1f; lineRenderer.endWidth = 0.1f; } else { return(false); } return(true); }