r2mods/ilspy_dump/ror2_csproj/RoR2.Items/HeadstomperBodyBehavior.cs

30 lines
768 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2.Items;
public class HeadstomperBodyBehavior : BaseItemBodyBehavior
{
private GameObject headstompersControllerObject;
[ItemDefAssociation(useOnServer = true, useOnClient = false)]
private static ItemDef GetItemDef()
{
return RoR2Content.Items.FallBoots;
}
private void OnEnable()
{
headstompersControllerObject = Object.Instantiate(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/HeadstompersController"));
headstompersControllerObject.GetComponent<NetworkedBodyAttachment>().AttachToGameObjectAndSpawn(base.body.gameObject);
}
private void OnDisable()
{
if ((bool)headstompersControllerObject)
{
Object.Destroy(headstompersControllerObject);
headstompersControllerObject = null;
}
}
}