mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-22 21:40:39 +00:00
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using QSB.Player;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.Animation.Player.Thrusters;
|
|
|
|
internal static class ThrusterManager
|
|
{
|
|
public static void CreateRemotePlayerVFX(PlayerInfo player)
|
|
{
|
|
var newVfx = player.Body.transform.Find("REMOTE_PlayerVFX").gameObject;
|
|
|
|
InitWashController(newVfx.transform.Find("ThrusterWash").gameObject, player);
|
|
InitFlameControllers(newVfx, player);
|
|
InitParticleControllers(newVfx, player);
|
|
}
|
|
|
|
private static void InitFlameControllers(GameObject root, PlayerInfo player)
|
|
{
|
|
var existingControllers = root.GetComponentsInChildren<RemoteThrusterFlameController>(true);
|
|
foreach (var controller in existingControllers)
|
|
{
|
|
controller.Init(player);
|
|
}
|
|
}
|
|
|
|
private static void InitParticleControllers(GameObject root, PlayerInfo player)
|
|
{
|
|
var existingBehaviours = root.GetComponentsInChildren<RemoteThrusterParticlesBehaviour>(true);
|
|
foreach (var item in existingBehaviours)
|
|
{
|
|
item.Init(player);
|
|
}
|
|
}
|
|
|
|
private static void InitWashController(GameObject root, PlayerInfo player)
|
|
{
|
|
var newObj = root.GetComponent<RemoteThrusterWashController>();
|
|
newObj.Init(player);
|
|
}
|
|
} |