using OWML.ModHelper.Events; using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace Marshmallow.Atmosphere { static class MakeVolumes { public static void Make(GameObject body, float groundSize, float topCloudSize) { GameObject volumes = new GameObject(); volumes.SetActive(false); volumes.transform.parent = body.transform; GameObject ruleset = new GameObject(); ruleset.transform.parent = volumes.transform; SphereShape ss = ruleset.AddComponent(); ss.SetCollisionMode(Shape.CollisionMode.Volume); ss.SetLayer(Shape.Layer.Sector); ss.layerMask = -1; ss.pointChecksOnly = true; ss.radius = topCloudSize; OWTriggerVolume trigvol = ruleset.AddComponent(); PlanetoidRuleset prule = ruleset.AddComponent(); prule.SetValue("_altitudeFloor", groundSize); prule.SetValue("_altitudeCeiling", topCloudSize); EffectRuleset er = ruleset.AddComponent(); er.SetValue("_type", EffectRuleset.BubbleType.Underwater); er.SetValue("_material", GameObject.Find("RulesetVolumes_GD").GetComponent().GetValue("_material")); er.SetValue("_cloudMaterial", GameObject.Find("RulesetVolumes_GD").GetComponent().GetValue("_cloudMaterial")); volumes.SetActive(true); } } }