mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Bramble vine removal (#450)
Option to remove default vines using bundle for unbatched collider
This commit is contained in:
commit
b05394bfb9
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
ManifestFileVersion: 0
|
||||
CRC: 1932961951
|
||||
CRC: 2314570133
|
||||
Hashes:
|
||||
AssetFileHash:
|
||||
serializedVersion: 2
|
||||
Hash: 79142e7d68648a06c0ed2fc15ebbac48
|
||||
Hash: 73793e57d83c10dbd917c9f721a4e60e
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: fae511e2df3c6c74353879b4753cf2eb
|
||||
@ -169,5 +169,6 @@ ClassTypes:
|
||||
Script: {instanceID: 0}
|
||||
SerializeReferenceClassIdentifiers: []
|
||||
Assets:
|
||||
- Assets/BrambleCollision.prefab
|
||||
- Assets/Vessel_Body.prefab
|
||||
Dependencies: []
|
||||
|
||||
@ -9,6 +9,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using static NewHorizons.Main;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -54,6 +55,7 @@ namespace NewHorizons.Builder.Body
|
||||
private static GameObject _exitWarps;
|
||||
private static GameObject _repelVolume;
|
||||
private static Material _material;
|
||||
private static GameObject _wallCollision;
|
||||
|
||||
private static bool _isInit;
|
||||
|
||||
@ -70,6 +72,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (_exitWarps == null) _exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Interactables_HubDimension/OuterWarp_Hub").InstantiateInactive().Rename("Prefab_Bramble_OuterWarp").DontDestroyOnLoad();
|
||||
if (_repelVolume == null) _repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive().Rename("Prefab_Bramble_RepelVolume").DontDestroyOnLoad();
|
||||
if (_material == null) _material = new Material(GameObject.Find("DB_PioneerDimension_Body/Sector_PioneerDimension").GetComponent<EffectRuleset>()._material).DontDestroyOnLoad();
|
||||
if (_wallCollision == null) _wallCollision = Main.NHPrivateAssetBundle.LoadAsset<GameObject>("BrambleCollision");
|
||||
}
|
||||
|
||||
public static GameObject Make(NewHorizonsBody body, GameObject go, NHAstroObject ao, Sector sector, OWRigidbody owRigidBody)
|
||||
@ -115,18 +118,22 @@ namespace NewHorizons.Builder.Body
|
||||
repelVolume.transform.parent = sector.transform;
|
||||
repelVolume.transform.localPosition = Vector3.zero;
|
||||
|
||||
// TODO: Remove default vines (once we create an asset bundle version of the outer sphere that has collisions
|
||||
/*
|
||||
var geoBatchedGroup = geometry.FindChild("BatchedGroup");
|
||||
var collider = geoBatchedGroup.FindChild("BatchedMeshColliders_0");
|
||||
collider.transform.parent = geometry.transform;
|
||||
GameObject.Destroy(geoBatchedGroup);
|
||||
|
||||
// Replace batched collision with our own if removing vines
|
||||
if (!config.hasVines)
|
||||
{
|
||||
GameObject.Destroy(geometry.FindChild("BatchedGroup"));
|
||||
var geoOtherComponentsGroup = geometry.FindChild("OtherComponentsGroup");
|
||||
var dimensionWalls = geoOtherComponentsGroup.FindChild("Terrain_DB_BrambleSphere_Outer_v2");
|
||||
dimensionWalls.transform.parent = geometry.transform;
|
||||
GameObject.Destroy(geoOtherComponentsGroup);
|
||||
*/
|
||||
|
||||
var newCollider = _wallCollision.InstantiateInactive();
|
||||
newCollider.transform.parent = dimensionWalls.transform;
|
||||
newCollider.transform.localPosition = Vector3.zero;
|
||||
newCollider.transform.localRotation = Quaternion.identity;
|
||||
newCollider.transform.localScale = Vector3.one;
|
||||
newCollider.SetActive(true);
|
||||
}
|
||||
|
||||
// fix some cull groups
|
||||
volumes.GetComponent<SectorCollisionGroup>()._sector = sector;
|
||||
|
||||
@ -49,6 +49,12 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
[DefaultValue(750f)] public float radius = 750f;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this dimensions has vines.
|
||||
/// Set to false if you want to create your own vines.
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool hasVines = true;
|
||||
|
||||
/// <summary>
|
||||
/// An array of integers from 0-5. By default, all entrances are allowed. To force this dimension to warp players in from only one point (like the anglerfish nest dimension in the base game) set this value to [3], [5], or similar. Values of 0-5 only.
|
||||
/// </summary>
|
||||
|
||||
@ -12,7 +12,6 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
public static class VesselWarpHandler
|
||||
{
|
||||
public static AssetBundle VesselBundle { get; private set; }
|
||||
public static GameObject VesselPrefab { get; private set; }
|
||||
public static GameObject VesselObject { get; private set; }
|
||||
public static VesselWarpController WarpController { get; private set; }
|
||||
@ -22,8 +21,7 @@ namespace NewHorizons.Handlers
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
VesselBundle = Instance.ModHelper.Assets.LoadBundle("Assets/newhorizons_private");
|
||||
VesselPrefab = VesselBundle.LoadAsset<GameObject>("Vessel_Body");
|
||||
VesselPrefab = Main.NHPrivateAssetBundle.LoadAsset<GameObject>("Vessel_Body");
|
||||
}
|
||||
|
||||
public static void LoadVessel()
|
||||
|
||||
@ -37,6 +37,7 @@ namespace NewHorizons
|
||||
public class Main : ModBehaviour
|
||||
{
|
||||
public static AssetBundle NHAssetBundle { get; private set; }
|
||||
public static AssetBundle NHPrivateAssetBundle { get; private set; }
|
||||
public static Main Instance { get; private set; }
|
||||
|
||||
// Settings
|
||||
@ -196,6 +197,7 @@ namespace NewHorizons
|
||||
|
||||
GlobalMessenger.AddListener("WakeUp", OnWakeUp);
|
||||
NHAssetBundle = ModHelper.Assets.LoadBundle("Assets/newhorizons_public");
|
||||
NHPrivateAssetBundle = ModHelper.Assets.LoadBundle("Assets/newhorizons_private");
|
||||
VesselWarpHandler.Initialize();
|
||||
|
||||
ResetConfigs(resetTranslation: false);
|
||||
|
||||
@ -575,6 +575,11 @@
|
||||
"format": "float",
|
||||
"default": 750.0
|
||||
},
|
||||
"hasVines": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this dimensions has vines.\nSet to false if you want to create your own vines.",
|
||||
"default": true
|
||||
},
|
||||
"allowedEntrances": {
|
||||
"type": "array",
|
||||
"description": "An array of integers from 0-5. By default, all entrances are allowed. To force this dimension to warp players in from only one point (like the anglerfish nest dimension in the base game) set this value to [3], [5], or similar. Values of 0-5 only.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user