mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 21:32:47 +00:00
38 lines
736 B
C#
38 lines
736 B
C#
using QSB.WorldSync;
|
|
|
|
namespace QSB.TornadoSync.WorldObjects
|
|
{
|
|
public class QSBTornado : WorldObject<TornadoController>
|
|
{
|
|
public override void Init(TornadoController attachedObject, int id)
|
|
{
|
|
ObjectId = id;
|
|
AttachedObject = attachedObject;
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|