2021-12-26 21:05:07 -08:00
|
|
|
|
using QSB.Player;
|
2021-05-07 14:58:37 +01:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.Animation.Player.Thrusters;
|
|
|
|
|
|
|
|
|
|
internal static class ThrusterManager
|
2021-05-07 14:58:37 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public static void CreateRemotePlayerVFX(PlayerInfo player)
|
2021-05-07 14:58:37 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
var newVfx = player.Body.transform.Find("REMOTE_PlayerVFX").gameObject;
|
2021-05-07 14:58:37 +01:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
CreateThrusterWashController(newVfx.transform.Find("ThrusterWash").gameObject, player);
|
|
|
|
|
CreateThrusterFlameController(newVfx, player);
|
|
|
|
|
}
|
2021-05-07 14:58:37 +01:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
private static void CreateThrusterFlameController(GameObject root, PlayerInfo player)
|
|
|
|
|
{
|
|
|
|
|
var existingControllers = root.GetComponentsInChildren<RemoteThrusterFlameController>(true);
|
|
|
|
|
foreach (var controller in existingControllers)
|
2021-05-07 19:17:09 +01:00
|
|
|
|
{
|
2022-03-02 19:46:33 -08:00
|
|
|
|
controller.Init(player);
|
2021-05-07 14:58:37 +01:00
|
|
|
|
}
|
2022-03-02 19:46:33 -08:00
|
|
|
|
}
|
2021-05-07 14:58:37 +01:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
private static void CreateThrusterWashController(GameObject root, PlayerInfo player)
|
|
|
|
|
{
|
|
|
|
|
var newObj = root.GetComponent<RemoteThrusterWashController>();
|
|
|
|
|
newObj.Init(player);
|
2021-05-07 14:58:37 +01:00
|
|
|
|
}
|
2022-02-24 22:04:54 -08:00
|
|
|
|
}
|