mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 00:32:43 +00:00
Create a proper fake sector for elevators
Also adjusted the loglift box shape to encompass the entire lift.
This commit is contained in:
parent
3ce50935c6
commit
2af563ceaa
@ -19,15 +19,16 @@ public class QSBElevator : WorldObject<Elevator>
|
|||||||
public override async UniTask Init(CancellationToken ct)
|
public override async UniTask Init(CancellationToken ct)
|
||||||
{
|
{
|
||||||
var boxShape = AttachedObject.gameObject.GetAddComponent<BoxShape>();
|
var boxShape = AttachedObject.gameObject.GetAddComponent<BoxShape>();
|
||||||
boxShape.center = new Vector3(0, 1.75f, 0.25f);
|
|
||||||
|
|
||||||
if (Name == "LogLift")
|
if (Name == "LogLift")
|
||||||
{
|
{
|
||||||
boxShape.size = new Vector3(5, 3.5f, 8);
|
boxShape.size = new Vector3(4.6f, 3.5f, 12);
|
||||||
|
boxShape.center = new Vector3(0.1f, 1.75f, 1.3f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boxShape.size = new Vector3(3, 3.5f, 3);
|
boxShape.size = new Vector3(3, 3.5f, 3);
|
||||||
|
boxShape.center = new Vector3(0, 1.75f, 0.25f);
|
||||||
}
|
}
|
||||||
|
|
||||||
_elevatorTrigger = AttachedObject.gameObject.GetAddComponent<OWTriggerVolume>();
|
_elevatorTrigger = AttachedObject.gameObject.GetAddComponent<OWTriggerVolume>();
|
||||||
|
@ -101,18 +101,9 @@ public class QSBSectorManager : WorldObjectManager
|
|||||||
// TH elevators
|
// TH elevators
|
||||||
foreach (var elevator in QSBWorldSync.GetUnityObjects<Elevator>())
|
foreach (var elevator in QSBWorldSync.GetUnityObjects<Elevator>())
|
||||||
{
|
{
|
||||||
// just create a sphere at the attach point lol
|
|
||||||
// since players will be moved there when riding the elevator
|
|
||||||
// --
|
|
||||||
// The attach point on the game object itself to
|
|
||||||
// sync player attachment properly.
|
|
||||||
FakeSector.Create(elevator.gameObject,
|
FakeSector.Create(elevator.gameObject,
|
||||||
elevator.GetComponentInParent<Sector>(),
|
elevator.GetComponentInParent<Sector>(),
|
||||||
x =>
|
x => x._triggerRoot = elevator.gameObject);
|
||||||
{
|
|
||||||
x.gameObject.AddComponent<OWTriggerVolume>();
|
|
||||||
x.gameObject.AddComponent<SphereShape>();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rafts
|
// rafts
|
||||||
|
Loading…
x
Reference in New Issue
Block a user