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

39 lines
735 B
C#
Raw Normal View History

using QSB.Utility;
2021-11-11 05:36:30 +00:00
using QSB.WorldSync;
2021-11-11 05:13:49 +00: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-11 05:51:14 +00:00
DebugLog.DebugWrite($"{LogName} - pre launch");
2021-11-11 05:36:30 +00:00
2021-11-11 05:13:49 +00:00
foreach (var particleSystem in AttachedObject._launchParticles)
{
particleSystem.Play();
}
}
else
{
2021-11-11 05:51:14 +00:00
DebugLog.DebugWrite($"{LogName} - launch");
2021-11-11 05:36:30 +00:00
2021-11-11 05:13:49 +00:00
AttachedObject.LaunchMeteor();
foreach (var particleSystem in AttachedObject._launchParticles)
{
particleSystem.Stop();
}
}
}
}
}