40 lines
753 B
C#
Raw Normal View History

2021-11-10 21:36:30 -08:00
using QSB.Player;
using QSB.Utility;
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;
}
public void LaunchMeteor(bool preLaunch)
{
if (preLaunch)
{
2021-11-10 21:51:14 -08:00
DebugLog.DebugWrite($"{LogName} - pre launch");
2021-11-10 21:36:30 -08:00
2021-11-10 21:13:49 -08:00
foreach (var particleSystem in AttachedObject._launchParticles)
{
particleSystem.Play();
}
}
else
{
2021-11-10 21:51:14 -08:00
DebugLog.DebugWrite($"{LogName} - launch");
2021-11-10 21:36:30 -08:00
2021-11-10 21:13:49 -08:00
AttachedObject.LaunchMeteor();
foreach (var particleSystem in AttachedObject._launchParticles)
{
particleSystem.Stop();
}
}
}
}
}