mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
28 lines
973 B
C#
28 lines
973 B
C#
using QSB.Messaging;
|
|
using QSB.WorldSync;
|
|
using System.Linq;
|
|
|
|
namespace QSB.EyeOfTheUniverse.GalaxyMap.Messages
|
|
{
|
|
internal class ZoomOutMessage : QSBMessage
|
|
{
|
|
public override bool ShouldReceive => WorldObjectManager.AllObjectsReady;
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
var controller = QSBWorldSync.GetUnityObjects<GalaxyMapController>().First();
|
|
controller.enabled = true;
|
|
Locator.GetPlayerController().SetColliderActivation(false);
|
|
controller._endlessObservatoryVolume.SetActivation(false);
|
|
controller._forestOfGalaxiesVolume.SetTriggerActivation(false);
|
|
ReticleController.Hide();
|
|
controller._zoomSpeed = 50f;
|
|
Locator.GetPlayerBody().AddVelocityChange(-Locator.GetPlayerCamera().transform.forward * controller._zoomSpeed);
|
|
controller._origEyePos = controller._eyeTransform.localPosition;
|
|
controller._audioSource.Play();
|
|
RumbleManager.PlayGalaxyZoom();
|
|
Locator.GetEyeStateManager().SetState(EyeState.ZoomOut);
|
|
}
|
|
}
|
|
}
|