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