r2mods/ilspy_dump/ror2_csproj/RolyPolyBoostedProjectileTi...

31 lines
703 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using RoR2;
using RoR2.Projectile;
using UnityEngine;
public class RolyPolyBoostedProjectileTimer : MonoBehaviour
{
private ChefController chefController;
private void OnEnable()
{
ProjectileController component = base.gameObject.GetComponent<ProjectileController>();
if ((bool)component)
{
component.onInitialized += GetChefController;
}
}
private void GetChefController(ProjectileController projectileController)
{
chefController = projectileController.owner.GetComponent<ChefController>();
}
private void Update()
{
if ((bool)chefController && !chefController.rolyPolyActive && Util.HasEffectiveAuthority(base.gameObject))
{
Object.Destroy(base.gameObject);
}
}
}