34 lines
650 B
C#
Raw Normal View History

using QSB.WorldSync;
2021-11-10 21:13:49 -08:00
2022-03-02 19:46:33 -08:00
namespace QSB.MeteorSync.WorldObjects;
public class QSBMeteorLauncher : WorldObject<MeteorLauncher>
2021-11-10 21:13:49 -08:00
{
2022-03-02 19:46:33 -08:00
public override void SendInitialState(uint to)
2021-11-10 21:13:49 -08:00
{
2022-03-02 19:46:33 -08:00
// todo SendInitialState
}
2022-03-02 19:46:33 -08:00
public int MeteorId;
public float LaunchSpeed;
2022-03-02 19:46:33 -08:00
public void PreLaunchMeteor()
{
foreach (var particleSystem in AttachedObject._launchParticles)
2021-11-10 21:13:49 -08:00
{
2022-03-02 19:46:33 -08:00
particleSystem.Play();
2021-11-11 02:08:03 -08:00
}
2022-03-02 19:46:33 -08:00
}
2021-11-11 02:08:03 -08:00
2022-03-02 19:46:33 -08:00
public void LaunchMeteor(int meteorId, float launchSpeed)
{
MeteorId = meteorId;
LaunchSpeed = launchSpeed;
2022-03-02 19:46:33 -08:00
AttachedObject.LaunchMeteor();
foreach (var particleSystem in AttachedObject._launchParticles)
{
particleSystem.Stop();
2021-11-10 21:13:49 -08:00
}
}
}