Agreed; there's a lot of cool things you can do once you get your own assemblies loaded into Rust. Modding is so much easier not having to go through Reflexil aside from setting up your function hooks. I've been playing with it for a few weeks now.
To avoid using GameObject and name checks, you can use the actual types for those structure objects:
Code:
foreach (StructureComponent obj in UnityEngine.Object.FindObjectsOfType(typeof(StructureComponent)))
{
if (obj.type == StructureComponent.StructureComponentType.Wall ||
obj.type == StructureComponent.StructureComponentType.Doorway ||
obj.type == StructureComponent.StructureComponentType.Ceiling)
{
if(obj.gameObject != null && obj.gameObject.activeInHierarchy)
{
obj.gameObject.SetActive(false);
}
}
}
I've been playing with shaders and labeling the structure components for experimental raiding tools, but the really large bases pose some issues with depth and figuring out the best way to go about it. I've come across bases with so many doors that when using the text gui shader, the entire thing is pretty much white.
I think the best option, and probably coolest, would be to make a second camera that you control that can just move around the base itself so you can see the layout first hand. Attached is an image of something I was playing with tonight, but for a different purpose. I'm working on setting up the camera and changing the terrain settings to be able to make my own external minimap.
Anyways though, nice share! I'm still learning Unity and whatnot, but I didn't think about disabling the walls to see through them. I was trying to look into using shaders to render them transparently, but this works
much better and is a lot easier to implement.