mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
finalize
This commit is contained in:
parent
cf2f45b6a7
commit
e45a4d1c3c
@ -232,7 +232,7 @@ namespace NewHorizons.Builder.Props
|
||||
if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector);
|
||||
prop.SetActive(true);
|
||||
|
||||
if (detail.hasPhysics || true)
|
||||
if (detail.hasPhysics)
|
||||
{
|
||||
var addPhysics = prop.AddComponent<AddPhysics>();
|
||||
addPhysics.Sector = sector;
|
||||
@ -428,14 +428,15 @@ namespace NewHorizons.Builder.Props
|
||||
if (!Sector)
|
||||
Logger.LogError($"Prop {name} has physics but no sector! Will fall through things when surrounding area is unloaded");
|
||||
|
||||
yield return new WaitForSeconds(3f);
|
||||
yield return new WaitForSeconds(.1f);
|
||||
|
||||
var parentBody = GetComponentInParent<OWRigidbody>();
|
||||
|
||||
// just disable all non triggers
|
||||
foreach (var collider in GetComponentsInChildren<Collider>(true))
|
||||
if (!collider.isTrigger)
|
||||
collider.enabled = false;
|
||||
// hack: make all mesh colliders convex
|
||||
// triggers are already convex but whatever
|
||||
// prints errors for non readable meshes but whatever
|
||||
foreach (var meshCollider in GetComponentsInChildren<MeshCollider>(true))
|
||||
meshCollider.convex = true;
|
||||
|
||||
var bodyGo = new GameObject($"{name}_Body");
|
||||
bodyGo.SetActive(false);
|
||||
|
||||
1
NewHorizons/External/Modules/PropModule.cs
vendored
1
NewHorizons/External/Modules/PropModule.cs
vendored
@ -232,6 +232,7 @@ namespace NewHorizons.External.Modules
|
||||
|
||||
/// <summary>
|
||||
/// Should this object dynamically move around?
|
||||
/// This tries to make all mesh colliders convex, as well as adding a sphere collider in case the detail has no others.
|
||||
/// </summary>
|
||||
public bool hasPhysics;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user