mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 12:54:51 +00:00
35 lines
758 B
C#
35 lines
758 B
C#
using QSB.Messaging;
|
|
using QSB.TornadoSync.Messages;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.TornadoSync.WorldObjects;
|
|
|
|
public class QSBTornado : WorldObject<TornadoController>
|
|
{
|
|
public override void SendInitialState(uint to) =>
|
|
this.SendMessage(new TornadoFormStateMessage(FormState) { To = to });
|
|
|
|
public bool FormState
|
|
{
|
|
get => AttachedObject._tornadoRoot.activeSelf // forming or formed or collapsing
|
|
&& !AttachedObject._tornadoCollapsing; // and not collapsing
|
|
set
|
|
{
|
|
if (FormState == value)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (value)
|
|
{
|
|
AttachedObject._tornadoCollapsing = false;
|
|
AttachedObject.StartFormation();
|
|
}
|
|
else
|
|
{
|
|
AttachedObject._secondsUntilFormation = 0;
|
|
AttachedObject.StartCollapse();
|
|
}
|
|
}
|
|
}
|
|
} |