Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void StripComponents(GameObject gameObject)
- {
- foreach (var ghostBase in gameObject.GetComponentsInChildren<DeactivateInGhostBase>())
- {
- ghostBase.gameObject.SetActive(false);
- }
- foreach (var baseSurfaceModel in gameObject.GetComponentsInChildren<BaseSurfaceModel>())
- {
- baseSurfaceModel.aboveWaterModel?.SetActive(false);
- baseSurfaceModel.underWaterModel?.SetActive(true);
- Object.DestroyImmediate(baseSurfaceModel);
- }
- switch (gameObject.name)
- {
- case "BaseCorridorCoverIShapeBottomIntOpened(Clone)":
- case "BaseCorridorCoverTShapeBottomIntOpened(Clone)":
- gameObject.transform.Find("collisions").gameObject.SetActive(false);
- break;
- case "BaseCorridorLadderBottom(Clone)":
- gameObject.transform.Find("logic").gameObject.SetActive(false);
- break;
- case "BaseMoonpool(Clone)":
- gameObject.transform.Find("entrance").gameObject.SetActive(false);
- gameObject.transform.Find("Flood_BaseMoonPool").gameObject.SetActive(false);
- var launchBay = gameObject.transform.Find("Launchbay_cinematic");
- foreach (Transform child in launchBay)
- {
- if (child.gameObject.name != "moon_pool_anim") child.gameObject.SetActive(false);
- }
- break;
- case "BaseObservatory(Clone)":
- Object.DestroyImmediate(gameObject.GetComponent<ObservatoryAmbientSound>());
- break;
- case "BaseCorridorHatch(Clone)":
- gameObject.transform.Find("underWater/collisions").gameObject.SetActive(false);
- break;
- }
- Object.DestroyImmediate(gameObject.GetComponentInChildren<BaseLadder>());
- // OPTIONAL, helps with bright lighting.
- // If you do this, I recommend you add your own SkyApplier to the prefab root through code.
- /*
- var skyApplierComponents = gameObject.GetComponents<SkyApplier>();
- foreach (var skyApplier in skyApplierComponents)
- {
- Object.DestroyImmediate(skyApplier);
- }
- var renderers = gameObject.GetComponentsInChildren<Renderer>();
- foreach (var renderer in renderers)
- {
- foreach (var material in renderer.materials)
- {
- material.SetFloat("_SpecInt", material.GetFloat("_SpecInt") * 0.05f);
- }
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment