FullCab will show up above steelmill

master
EvilPunkin 2023-08-14 17:42:40 -07:00
parent 1501212daa
commit 3c48300bf9
7 changed files with 36 additions and 42 deletions

Binary file not shown.

View File

@ -1,7 +0,0 @@
ManifestFileVersion: 0
CRC: 966447639
AssetBundleManifest:
AssetBundleInfos:
Info_0:
Name: models.fullcab
Dependencies: {}

Binary file not shown.

View File

@ -1,29 +0,0 @@
ManifestFileVersion: 0
CRC: 1261696359
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 1858f3bb33448328d19383b4869ef0d7
TypeTreeHash:
serializedVersion: 2
Hash: ae2cf77de671e115b4e55d2b65767202
HashAppended: 0
ClassTypes:
- Class: 1
Script: {instanceID: 0}
- Class: 4
Script: {instanceID: 0}
- Class: 21
Script: {instanceID: 0}
- Class: 23
Script: {instanceID: 0}
- Class: 33
Script: {instanceID: 0}
- Class: 43
Script: {instanceID: 0}
- Class: 48
Script: {instanceID: 0}
SerializeReferenceClassIdentifiers: []
Assets:
- Assets/better282/fullcab.prefab
Dependencies: []

View File

@ -8,7 +8,6 @@ using System.Collections.Generic;
using DV; using DV;
using UnityEngine.UI; using UnityEngine.UI;
using System.ComponentModel; using System.ComponentModel;
using static dumb282tweaks.Main;
namespace dumb282tweaks; namespace dumb282tweaks;
@ -29,6 +28,8 @@ public static class Main {
"German" "German"
}; };
private static AssetBundle loadedAssetBundle;
// Load // Load
private static bool Load(UnityModManager.ModEntry modEntry) { private static bool Load(UnityModManager.ModEntry modEntry) {
Harmony? harmony = null; Harmony? harmony = null;
@ -43,8 +44,7 @@ public static class Main {
harmony = new Harmony(Instance.Info.Id); harmony = new Harmony(Instance.Info.Id);
harmony.PatchAll(Assembly.GetExecutingAssembly()); harmony.PatchAll(Assembly.GetExecutingAssembly());
//var assets = AssetBundle.LoadFromFile(Path.Combine(modEntry.Path, "model.fullcab")); WorldStreamingInit.LoadingFinished += GameLoaded;
//var fullcab = assets.LoadAsset<GameObject>("fullcab");
} catch (Exception ex) { } catch (Exception ex) {
Instance.Logger.LogException($"Failed to load {Instance.Info.DisplayName}:", ex); Instance.Logger.LogException($"Failed to load {Instance.Info.DisplayName}:", ex);
harmony?.UnpatchAll(Instance.Info.Id); harmony?.UnpatchAll(Instance.Info.Id);
@ -54,6 +54,29 @@ public static class Main {
return true; return true;
} }
private static void GameLoaded() {
WorldMover worldMoverScript = GameObject.Find("WorldMover").GetComponent<WorldMover>();
// Asset Loading
var modelPath = Path.Combine(Instance.Path.ToString(), "assets\\fullcab");
var loadedAssetBundle = AssetBundle.LoadFromFile(modelPath);
GameObject fullCabLoad = loadedAssetBundle.LoadAsset<GameObject>("Assets/fullcab.prefab");
//GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
GameObject fullCab = GameObject.Instantiate(fullCabLoad);
fullCab.transform.position = PlayerManager.GetWorldAbsolutePlayerPosition() + new Vector3(0, 6, 0);
fullCab.transform.localScale = new Vector3(1, 1, 1);
fullCab.transform.position += WorldMover.currentMove;
worldMoverScript.AddObjectToMove(fullCab.transform);
// Find all GameObjects
//foreach(GameObject obj in Resources.FindObjectsOfTypeAll<GameObject>()) {
//}
}
// GUI Rendering // GUI Rendering
static void OnGUI(UnityModManager.ModEntry modEntry) { static void OnGUI(UnityModManager.ModEntry modEntry) {
GUILayout.BeginVertical(); GUILayout.BeginVertical();
@ -66,9 +89,6 @@ public static class Main {
GUILayout.Label("Smoke Deflector Type"); GUILayout.Label("Smoke Deflector Type");
Settings.smokeDeflectorType = (SmokeDeflectorType) GUILayout.SelectionGrid((int) Settings.smokeDeflectorType, smokeDeflectorTypeTexts, 1, "toggle"); Settings.smokeDeflectorType = (SmokeDeflectorType) GUILayout.SelectionGrid((int) Settings.smokeDeflectorType, smokeDeflectorTypeTexts, 1, "toggle");
GUILayout.Space(2);
GUILayout.Label("Texture Utility");
GUILayout.EndVertical(); GUILayout.EndVertical();
} }

View File

@ -31,6 +31,9 @@
<Reference Include="Assembly-CSharp-firstpass"> <Reference Include="Assembly-CSharp-firstpass">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath> <HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference> </Reference>
<Reference Include="DV.Utils">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\DV.Utils.dll</HintPath>
</Reference>
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.dll</HintPath> <HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.dll</HintPath>
</Reference> </Reference>

View File

@ -21,6 +21,13 @@ $ZipOutDir = "$ZipWorkDir/$modId"
New-Item "$ZipOutDir" -ItemType Directory -Force New-Item "$ZipOutDir" -ItemType Directory -Force
Copy-Item -Force -Path $FilesToInclude -Destination "$ZipOutDir" Copy-Item -Force -Path $FilesToInclude -Destination "$ZipOutDir"
# Get-ChildItem $sourceDir -filter "*" -recurse | `
# foreach{
# $targetFile = $targetDir + $_.FullName.SubString($sourceDir.Length);
# New-Item -ItemType File -Path $targetFile -Force;
# Copy-Item $_.FullName -destination $targetFile
# }
if (!$NoArchive) if (!$NoArchive)
{ {
$FILE_NAME = "$DistDir/${modId}_v$modVersion.zip" $FILE_NAME = "$DistDir/${modId}_v$modVersion.zip"