41 lines
796 B
C#
Raw Normal View History

using QSB.Utility;
2021-11-10 21:36:30 -08:00
using QSB.WorldSync;
2021-11-10 21:13:49 -08:00
namespace QSB.MeteorSync.WorldObjects
{
public class QSBMeteorLauncher : WorldObject<MeteorLauncher>
{
public override void Init(MeteorLauncher attachedObject, int id)
{
ObjectId = id;
AttachedObject = attachedObject;
}
2021-11-11 02:08:03 -08:00
public float LaunchSpeed;
public void PreLaunchMeteor()
2021-11-10 21:13:49 -08:00
{
2021-11-11 02:08:03 -08:00
foreach (var particleSystem in AttachedObject._launchParticles)
2021-11-10 21:13:49 -08:00
{
2021-11-11 02:08:03 -08:00
particleSystem.Play();
2021-11-10 21:13:49 -08:00
}
2021-11-10 21:36:30 -08:00
2021-11-11 02:08:03 -08:00
DebugLog.DebugWrite($"{LogName} - pre launch");
}
public void LaunchMeteor(float launchSpeed)
{
LaunchSpeed = launchSpeed;
AttachedObject.LaunchMeteor();
foreach (var particleSystem in AttachedObject._launchParticles)
{
particleSystem.Stop();
2021-11-10 21:13:49 -08:00
}
2021-11-11 02:08:03 -08:00
DebugLog.DebugWrite($"{LogName} - launch {launchSpeed}");
2021-11-10 21:13:49 -08:00
}
}
}