quantum-space-buddies/QSB/JellyfishSync/WorldObjects/QSBJellyfish.cs

30 lines
853 B
C#
Raw Normal View History

using QSB.JellyfishSync.Messages;
using QSB.JellyfishSync.TransformSync;
2022-01-21 23:13:16 +00:00
using QSB.Messaging;
using QSB.Utility.LinkedWorldObject;
using UnityEngine;
2021-12-01 09:10:38 +00:00
2022-03-03 03:46:33 +00:00
namespace QSB.JellyfishSync.WorldObjects;
public class QSBJellyfish : LinkedWorldObject<JellyfishController, JellyfishTransformSync>
2021-12-01 09:10:38 +00:00
{
2022-03-03 03:46:33 +00:00
public override bool ShouldDisplayDebug() => false;
protected override GameObject NetworkObjectPrefab => QSBNetworkManager.singleton.JellyfishPrefab;
protected override bool SpawnWithServerAuthority => false;
2021-12-01 10:23:12 +00:00
2022-03-03 03:46:33 +00:00
public override void SendInitialState(uint to) =>
this.SendMessage(new JellyfishRisingMessage(AttachedObject._isRising) { To = to });
2022-01-21 23:13:16 +00:00
2022-03-03 03:46:33 +00:00
public void SetIsRising(bool value)
{
if (AttachedObject._isRising == value)
2021-12-01 10:23:12 +00:00
{
2022-03-03 03:46:33 +00:00
return;
}
2022-03-03 03:46:33 +00:00
AttachedObject._isRising = value;
AttachedObject._attractiveFluidVolume.SetVolumeActivation(!value);
2021-12-01 09:10:38 +00:00
}
}