33 lines
900 B
C#
Raw Normal View History

2022-05-14 19:53:00 +01:00
using BepInEx;
using Comfort.Common;
using EFT;
using EFT.Interactive;
using System.Linq;
using UnityEngine;
namespace BushWhacker
{
2022-07-27 22:26:54 +01:00
[BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.0")]
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-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");
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
}
}
}
}
}