43 lines
1.1 KiB
C#
Raw Normal View History

2022-05-14 19:53:00 +01:00
using BepInEx;
using EFT.Interactive;
using System.Linq;
using UnityEngine;
namespace BushWhacker
{
2022-09-17 20:46:11 +01:00
[BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.4")]
2022-05-14 19:53:00 +01:00
public class BushWhacker : BaseUnityPlugin
{
public void Start()
{
new Patch().Enable();
}
public static void DisableBushes()
{
2022-06-11 22:25:07 +01:00
var bushes = FindObjectsOfType<ObstacleCollider>().ToList();
2022-08-19 17:27:56 +01:00
var swamps = FindObjectsOfType<BoxCollider>().ToList();
foreach (var swamp in swamps)
{
if (swamp.name == "Swamp_collider")
{
DestroyImmediate(swamp);
}
}
2022-05-14 19:53:00 +01:00
foreach (var bushesItem in bushes)
{
2022-06-11 22:25:07 +01:00
var filbert = bushesItem?.transform?.parent?.gameObject?.name?.Contains("filbert");
var fibert = bushesItem?.transform?.parent?.gameObject?.name?.Contains("fibert");
2022-08-19 17:27:56 +01:00
2022-06-11 22:25:07 +01:00
if (filbert == true || fibert == true)
2022-05-14 19:53:00 +01:00
{
2022-06-11 22:25:07 +01:00
DestroyImmediate(bushesItem);
2022-05-14 19:53:00 +01:00
}
}
}
}
}