quantum-space-buddies/QSB/MeteorSync/WorldObjects/QSBMeteorLauncher.cs

36 lines
679 B
C#
Raw Normal View History

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