2022-03-14 03:22:44 -07:00
|
|
|
|
using QSB.JellyfishSync.Messages;
|
2022-01-14 22:54:18 -08:00
|
|
|
|
using QSB.JellyfishSync.TransformSync;
|
2022-01-21 15:13:16 -08:00
|
|
|
|
using QSB.Messaging;
|
2022-03-14 01:53:12 -07:00
|
|
|
|
using QSB.Utility.LinkedWorldObject;
|
2022-03-14 03:22:44 -07:00
|
|
|
|
using UnityEngine;
|
2021-12-01 01:10:38 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.JellyfishSync.WorldObjects;
|
|
|
|
|
|
2022-03-14 03:22:44 -07:00
|
|
|
|
public class QSBJellyfish : LinkedWorldObject<JellyfishController, JellyfishTransformSync>
|
2021-12-01 01:10:38 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override bool ShouldDisplayDebug() => false;
|
2022-01-21 17:56:20 -08:00
|
|
|
|
|
2022-03-14 03:22:44 -07:00
|
|
|
|
protected override GameObject NetworkObjectPrefab => QSBNetworkManager.singleton.JellyfishPrefab;
|
2023-05-08 11:38:24 -07:00
|
|
|
|
protected override bool SpawnWithServerOwnership => false;
|
2021-12-01 02:23:12 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void SendInitialState(uint to) =>
|
|
|
|
|
this.SendMessage(new JellyfishRisingMessage(AttachedObject._isRising) { To = to });
|
2022-01-21 15:13:16 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public void SetIsRising(bool value)
|
|
|
|
|
{
|
|
|
|
|
if (AttachedObject._isRising == value)
|
2021-12-01 02:23:12 -08:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
return;
|
2022-02-27 04:40:44 -08:00
|
|
|
|
}
|
2022-03-02 19:46:33 -08:00
|
|
|
|
|
|
|
|
|
AttachedObject._isRising = value;
|
|
|
|
|
AttachedObject._attractiveFluidVolume.SetVolumeActivation(!value);
|
2021-12-01 01:10:38 -08:00
|
|
|
|
}
|
2022-03-14 01:53:12 -07:00
|
|
|
|
}
|