From 3ca6d9a3dbf8303cc3b35b7d903655f599a8f711 Mon Sep 17 00:00:00 2001 From: Joshua Thome Date: Fri, 17 Mar 2023 14:13:23 -0500 Subject: [PATCH] Migrate more modules to the GeneralPropBuilder --- .../Builder/Props/GeneralPropBuilder.cs | 11 +- .../Builder/Props/ProjectionBuilder.cs | 4 +- NewHorizons/Builder/Props/QuantumBuilder.cs | 2 +- NewHorizons/Builder/Props/RaftBuilder.cs | 2 +- NewHorizons/Builder/Props/SignalBuilder.cs | 21 +- NewHorizons/Builder/Props/TornadoBuilder.cs | 4 +- .../TranslatorText/TranslatorTextBuilder.cs | 227 ++---------------- .../Builder/ShipLog/EntryLocationBuilder.cs | 2 +- NewHorizons/Builder/Volumes/VolumeBuilder.cs | 28 +-- NewHorizons/External/Modules/SignalModule.cs | 17 +- NewHorizons/External/Modules/VolumesModule.cs | 22 +- 11 files changed, 34 insertions(+), 306 deletions(-) diff --git a/NewHorizons/Builder/Props/GeneralPropBuilder.cs b/NewHorizons/Builder/Props/GeneralPropBuilder.cs index fa617c91..ec6f9aa1 100644 --- a/NewHorizons/Builder/Props/GeneralPropBuilder.cs +++ b/NewHorizons/Builder/Props/GeneralPropBuilder.cs @@ -12,7 +12,7 @@ namespace NewHorizons.Builder.Props { public static class GeneralPropBuilder { - public static GameObject MakeFromExisting(GameObject go, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody) + public static GameObject MakeFromExisting(GameObject go, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody = false, MVector3 normal = null) { if (!string.IsNullOrEmpty(info.rename)) { @@ -52,24 +52,25 @@ namespace NewHorizons.Builder.Props if (alignToBody) { var up = (go.transform.position - planetGO.transform.position).normalized; + if (normal != null) up = planetGO.transform.TransformDirection(normal); go.transform.rotation = Quaternion.FromToRotation(Vector3.up, up); go.transform.rotation *= rot; } return go; } - public static GameObject MakeNew(string defaultName, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody) + public static GameObject MakeNew(string defaultName, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody = false, MVector3 normal = null) { GameObject go = new GameObject(defaultName); go.SetActive(false); - return MakeFromExisting(go, planetGO, sector, info, alignToBody); + return MakeFromExisting(go, planetGO, sector, info, alignToBody, normal); } - public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody) + public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody = false, MVector3 normal = null) { GameObject go = prefab.InstantiateInactive(); go.name = defaultName; - return MakeFromExisting(go, planetGO, sector, info, alignToBody); + return MakeFromExisting(go, planetGO, sector, info, alignToBody, normal); } } } diff --git a/NewHorizons/Builder/Props/ProjectionBuilder.cs b/NewHorizons/Builder/Props/ProjectionBuilder.cs index 0057d2d4..19e1225f 100644 --- a/NewHorizons/Builder/Props/ProjectionBuilder.cs +++ b/NewHorizons/Builder/Props/ProjectionBuilder.cs @@ -93,7 +93,7 @@ namespace NewHorizons.Builder.Props if (_slideReelPrefab == null) return null; - var slideReelObj = GeneralPropBuilder.MakeFromPrefab(_slideReelPrefab, $"Prefab_IP_Reel_{mod.ModHelper.Manifest.Name}", planetGO, sector, info, false); + var slideReelObj = GeneralPropBuilder.MakeFromPrefab(_slideReelPrefab, $"Prefab_IP_Reel_{mod.ModHelper.Manifest.Name}", planetGO, sector, info); var slideReel = slideReelObj.GetComponent(); slideReel.SetSector(sector); @@ -166,7 +166,7 @@ namespace NewHorizons.Builder.Props if (_autoPrefab == null) return null; - var projectorObj = GeneralPropBuilder.MakeFromPrefab(_autoPrefab, $"Prefab_IP_AutoProjector_{mod.ModHelper.Manifest.Name}", planetGO, sector, info, false); + var projectorObj = GeneralPropBuilder.MakeFromPrefab(_autoPrefab, $"Prefab_IP_AutoProjector_{mod.ModHelper.Manifest.Name}", planetGO, sector, info); var autoProjector = projectorObj.GetComponent(); autoProjector._sector = sector; diff --git a/NewHorizons/Builder/Props/QuantumBuilder.cs b/NewHorizons/Builder/Props/QuantumBuilder.cs index 39665a90..9c759808 100644 --- a/NewHorizons/Builder/Props/QuantumBuilder.cs +++ b/NewHorizons/Builder/Props/QuantumBuilder.cs @@ -50,7 +50,7 @@ namespace NewHorizons.Builder.Props { var socketInfo = quantumGroup.sockets[i]; - var socket = GeneralPropBuilder.MakeNew("Socket " + i, go, sector, socketInfo, false); + var socket = GeneralPropBuilder.MakeNew("Socket " + i, go, sector, socketInfo); if (socketInfo.isRelativeToGroup) { diff --git a/NewHorizons/Builder/Props/RaftBuilder.cs b/NewHorizons/Builder/Props/RaftBuilder.cs index b816c400..4440dbfa 100644 --- a/NewHorizons/Builder/Props/RaftBuilder.cs +++ b/NewHorizons/Builder/Props/RaftBuilder.cs @@ -52,7 +52,7 @@ namespace NewHorizons.Builder.Props if (_prefab == null || sector == null) return null; - GameObject raftObject = GeneralPropBuilder.MakeFromPrefab(_prefab, "Raft_Body", planetGO, sector, info, false); + GameObject raftObject = GeneralPropBuilder.MakeFromPrefab(_prefab, "Raft_Body", planetGO, sector, info); StreamingHandler.SetUpStreaming(raftObject, sector); diff --git a/NewHorizons/Builder/Props/SignalBuilder.cs b/NewHorizons/Builder/Props/SignalBuilder.cs index 876fc2c2..2cbf1118 100644 --- a/NewHorizons/Builder/Props/SignalBuilder.cs +++ b/NewHorizons/Builder/Props/SignalBuilder.cs @@ -109,26 +109,7 @@ namespace NewHorizons.Builder.Props public static GameObject Make(GameObject planetGO, Sector sector, SignalModule.SignalInfo info, IModBehaviour mod) { - var signalGO = new GameObject($"Signal_{info.name}"); - signalGO.SetActive(false); - signalGO.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) - { - signalGO.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) signalGO.transform.localPosition = pos; - else signalGO.transform.position = planetGO.transform.TransformPoint(pos); + var signalGO = GeneralPropBuilder.MakeNew($"Signal_{info.name}", planetGO, sector, info); signalGO.layer = LayerMask.NameToLayer("AdvancedEffectVolume"); var source = signalGO.AddComponent(); diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index 80e9aea3..4ba7fa85 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -100,7 +100,9 @@ namespace NewHorizons.Builder.Props { var prefab = downwards ? _downPrefab.InstantiateInactive() : _upPrefab.InstantiateInactive(); var tornadoGO = GeneralPropBuilder.MakeFromPrefab(prefab, downwards ? "Tornado_Down" : "Tornado_Up", planetGO, sector, info, true); - if (info.position == null && !info.isRelativeToParent) + + // Override general prop position with randomized default position + if (info.position == null) { tornadoGO.transform.position = planetGO.transform.TransformPoint(position); } diff --git a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs index 96899393..59a7b73d 100644 --- a/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs +++ b/NewHorizons/Builder/Props/TranslatorText/TranslatorTextBuilder.cs @@ -131,64 +131,25 @@ namespace NewHorizons.Builder.Props case PropModule.NomaiTextInfo.NomaiTextType.Wall: { var nomaiWallTextObj = MakeWallText(planetGO, sector, info, xmlPath, nhBody).gameObject; - - if (!string.IsNullOrEmpty(info.rename)) + + if (info.normal != null) { - nomaiWallTextObj.name = info.rename; - } + // In global coordinates (normal was in local coordinates) + var up = (nomaiWallTextObj.transform.position - planetGO.transform.position).normalized; + var forward = planetGO.transform.TransformDirection(info.normal).normalized; - nomaiWallTextObj.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) + if (info.isRelativeToParent) { - nomaiWallTextObj.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) - { - nomaiWallTextObj.transform.localPosition = pos; - if (info.normal != null) - { - // In global coordinates (normal was in local coordinates) - var up = (nomaiWallTextObj.transform.position - planetGO.transform.position).normalized; - var forward = planetGO.transform.TransformDirection(info.normal).normalized; - nomaiWallTextObj.transform.up = up; nomaiWallTextObj.transform.forward = forward; - } - if (info.rotation != null) + } else { - nomaiWallTextObj.transform.localRotation = Quaternion.Euler(info.rotation); - } - } - else - { - nomaiWallTextObj.transform.position = planetGO.transform.TransformPoint(pos); - if (info.normal != null) - { - // In global coordinates (normal was in local coordinates) - var up = (nomaiWallTextObj.transform.position - planetGO.transform.position).normalized; - var forward = planetGO.transform.TransformDirection(info.normal).normalized; - nomaiWallTextObj.transform.forward = forward; var desiredUp = Vector3.ProjectOnPlane(up, forward); var zRotation = Vector3.SignedAngle(nomaiWallTextObj.transform.up, desiredUp, forward); nomaiWallTextObj.transform.RotateAround(nomaiWallTextObj.transform.position, forward, zRotation); } - if (info.rotation != null) - { - nomaiWallTextObj.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation)); - } } // nomaiWallTextObj.GetComponent().DrawBoundsWithDebugSpheres(); @@ -200,16 +161,7 @@ namespace NewHorizons.Builder.Props } case PropModule.NomaiTextInfo.NomaiTextType.Scroll: { - var customScroll = _scrollPrefab.InstantiateInactive(); - - if (!string.IsNullOrEmpty(info.rename)) - { - customScroll.name = info.rename; - } - else - { - customScroll.name = _scrollPrefab.name; - } + var customScroll = GeneralPropBuilder.MakeFromPrefab(_scrollPrefab, _scrollPrefab.name, planetGO, sector, info); var nomaiWallText = MakeWallText(planetGO, sector, info, xmlPath, nhBody); nomaiWallText.transform.parent = customScroll.transform; @@ -237,36 +189,6 @@ namespace NewHorizons.Builder.Props // Else when you put them down you can't pick them back up customScroll.GetComponent()._physicsRemoved = false; - // Place scroll - customScroll.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) - { - customScroll.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) customScroll.transform.localPosition = pos; - else customScroll.transform.position = planetGO.transform.TransformPoint(pos); - - var up = planetGO.transform.InverseTransformPoint(customScroll.transform.position).normalized; - if (info.rotation != null) - { - customScroll.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation)); - } - else - { - customScroll.transform.rotation = Quaternion.FromToRotation(customScroll.transform.up, up) * customScroll.transform.rotation; - } - customScroll.SetActive(true); Delay.FireOnNextUpdate( @@ -291,39 +213,7 @@ namespace NewHorizons.Builder.Props } case PropModule.NomaiTextInfo.NomaiTextType.Computer: { - var computerObject = _computerPrefab.InstantiateInactive(); - - if (!string.IsNullOrEmpty(info.rename)) - { - computerObject.name = info.rename; - } - else - { - computerObject.name = _computerPrefab.name; - } - - computerObject.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) - { - computerObject.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) computerObject.transform.localPosition = pos; - else computerObject.transform.position = planetGO.transform.TransformPoint(pos); - - var up = computerObject.transform.position - planetGO.transform.position; - if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal); - computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation; + var computerObject = GeneralPropBuilder.MakeFromPrefab(_computerPrefab, _computerPrefab.name, planetGO, sector, info, true, info.normal); var computer = computerObject.GetComponent(); computer.SetSector(sector); @@ -395,48 +285,8 @@ namespace NewHorizons.Builder.Props case PropModule.NomaiTextInfo.NomaiTextType.Cairn: case PropModule.NomaiTextInfo.NomaiTextType.CairnVariant: { - var cairnObject = (info.type == PropModule.NomaiTextInfo.NomaiTextType.CairnVariant ? _cairnVariantPrefab : _cairnPrefab).InstantiateInactive(); - - if (!string.IsNullOrEmpty(info.rename)) - { - cairnObject.name = info.rename; - } - else - { - cairnObject.name = _cairnPrefab.name; - } - - cairnObject.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) - { - cairnObject.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) cairnObject.transform.localPosition = pos; - else cairnObject.transform.position = planetGO.transform.TransformPoint(pos); - - if (info.rotation != null) - { - var rot = Quaternion.Euler(info.rotation); - if (info.isRelativeToParent) cairnObject.transform.localRotation = rot; - else cairnObject.transform.rotation = planetGO.transform.TransformRotation(rot); - } - else - { - // By default align it to normal - var up = (cairnObject.transform.position - planetGO.transform.position).normalized; - cairnObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * cairnObject.transform.rotation; - } + var cairnPrefab = info.type == PropModule.NomaiTextInfo.NomaiTextType.CairnVariant ? _cairnVariantPrefab : _cairnPrefab; + var cairnObject = GeneralPropBuilder.MakeFromPrefab(cairnPrefab, _cairnPrefab.name, planetGO, sector, info, info.rotation == null); // Idk do we have to set it active before finding things? cairnObject.SetActive(true); @@ -476,17 +326,12 @@ namespace NewHorizons.Builder.Props rotation = info.rotation, position = info.position, isRelativeToParent = info.isRelativeToParent, - rename = info.rename + rename = info.rename, + alignToNormal = info.rotation == null, }; var recorderObject = DetailBuilder.Make(planetGO, sector, prefab, detailInfo); recorderObject.SetActive(false); - if (info.rotation == null) - { - var up = recorderObject.transform.position - planetGO.transform.position; - recorderObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * recorderObject.transform.rotation; - } - var nomaiText = recorderObject.GetComponentInChildren(); nomaiText.SetSector(sector); @@ -504,52 +349,11 @@ namespace NewHorizons.Builder.Props } case PropModule.NomaiTextInfo.NomaiTextType.Trailmarker: { - var trailmarkerObject = _trailmarkerPrefab.InstantiateInactive(); - - if (!string.IsNullOrEmpty(info.rename)) - { - trailmarkerObject.name = info.rename; - } - else - { - trailmarkerObject.name = _trailmarkerPrefab.name; - } - - trailmarkerObject.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) - { - trailmarkerObject.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) trailmarkerObject.transform.localPosition = pos; - else trailmarkerObject.transform.position = planetGO.transform.TransformPoint(pos); + var trailmarkerObject = GeneralPropBuilder.MakeFromPrefab(_trailmarkerPrefab, _trailmarkerPrefab.name, planetGO, sector, info, info.rotation == null); // shrink because that is what mobius does on all trailmarkers or else they are the size of the player trailmarkerObject.transform.localScale = Vector3.one * 0.75f; - if (info.rotation != null) - { - var rot = Quaternion.Euler(info.rotation); - if (info.isRelativeToParent) trailmarkerObject.transform.localRotation = rot; - else trailmarkerObject.transform.rotation = planetGO.transform.TransformRotation(rot); - } - else - { - // By default align it to normal - var up = (trailmarkerObject.transform.position - planetGO.transform.position).normalized; - trailmarkerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * trailmarkerObject.transform.rotation; - } - // Idk do we have to set it active before finding things? trailmarkerObject.SetActive(true); @@ -576,8 +380,7 @@ namespace NewHorizons.Builder.Props private static NomaiWallText MakeWallText(GameObject go, Sector sector, PropModule.NomaiTextInfo info, string xmlPath, NewHorizonsBody nhBody) { - GameObject nomaiWallTextObj = new GameObject("NomaiWallText"); - nomaiWallTextObj.SetActive(false); + GameObject nomaiWallTextObj = GeneralPropBuilder.MakeNew("NomaiWallText", go, sector, info); var box = nomaiWallTextObj.AddComponent(); box.center = new Vector3(-0.0643f, 1.1254f, 0f); diff --git a/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs b/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs index 55f3e0c5..ace39be3 100644 --- a/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs +++ b/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs @@ -12,7 +12,7 @@ namespace NewHorizons.Builder.ShipLog private static readonly List _locationsToInitialize = new List(); public static void Make(GameObject go, Sector sector, PropModule.EntryLocationInfo info, IModBehaviour mod) { - GameObject entryLocationGameObject = GeneralPropBuilder.MakeNew("Entry Location (" + info.id + ")", go, sector, info, false); + GameObject entryLocationGameObject = GeneralPropBuilder.MakeNew("Entry Location (" + info.id + ")", go, sector, info); ShipLogEntryLocation newLocation = entryLocationGameObject.AddComponent(); newLocation._entryID = info.id; diff --git a/NewHorizons/Builder/Volumes/VolumeBuilder.cs b/NewHorizons/Builder/Volumes/VolumeBuilder.cs index cc35c636..a94a6c23 100644 --- a/NewHorizons/Builder/Volumes/VolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VolumeBuilder.cs @@ -1,3 +1,4 @@ +using NewHorizons.Builder.Props; using NewHorizons.Components; using NewHorizons.External.Modules; using UnityEngine; @@ -9,32 +10,7 @@ namespace NewHorizons.Builder.Volumes { public static TVolume Make(GameObject planetGO, Sector sector, VolumesModule.VolumeInfo info) where TVolume : MonoBehaviour //Could be BaseVolume but I need to create vanilla volumes too. { - var go = new GameObject(typeof(TVolume).Name); - go.SetActive(false); - - go.transform.parent = sector?.transform ?? planetGO.transform; - - if (!string.IsNullOrEmpty(info.rename)) - { - go.name = info.rename; - } - - if (!string.IsNullOrEmpty(info.parentPath)) - { - var newParent = planetGO.transform.Find(info.parentPath); - if (newParent != null) - { - go.transform.parent = newParent; - } - else - { - Logger.LogError($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); - } - } - - var pos = (Vector3)(info.position ?? Vector3.zero); - if (info.isRelativeToParent) go.transform.localPosition = pos; - else go.transform.position = planetGO.transform.TransformPoint(pos); + var go = GeneralPropBuilder.MakeNew(typeof(TVolume).Name, planetGO, sector, info); go.layer = LayerMask.NameToLayer("BasicEffectVolume"); var shape = go.AddComponent(); diff --git a/NewHorizons/External/Modules/SignalModule.cs b/NewHorizons/External/Modules/SignalModule.cs index 255ebc9b..de5f474f 100644 --- a/NewHorizons/External/Modules/SignalModule.cs +++ b/NewHorizons/External/Modules/SignalModule.cs @@ -15,7 +15,7 @@ namespace NewHorizons.External.Modules public SignalInfo[] signals; [JsonObject] - public class SignalInfo + public class SignalInfo : PropModule.PositionedPropInfo { [Obsolete("audioClip is deprecated, please use audio instead")] public string audioClip; @@ -61,11 +61,6 @@ namespace NewHorizons.External.Modules /// [DefaultValue(true)] public bool onlyAudibleToScope = true; - /// - /// Position of the signal's source - /// - public MVector3 position; - /// /// A ship log fact to reveal when the signal is identified. /// @@ -75,16 +70,6 @@ namespace NewHorizons.External.Modules /// Radius of the sphere giving off the signal. /// [DefaultValue(1f)] public float sourceRadius = 1f; - - /// - /// The relative path from the planet to the parent of this signal. Optional (will default to the root sector). - /// - public string parentPath; - - /// - /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. - /// - public bool isRelativeToParent; } } } \ No newline at end of file diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index 79742830..230665c0 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -117,33 +117,13 @@ namespace NewHorizons.External.Modules public LoadCreditsVolumeInfo[] creditsVolume; [JsonObject] - public class VolumeInfo + public class VolumeInfo : PropModule.PositionedPropInfo { - /// - /// The location of this volume. Optional (will default to 0,0,0). - /// - public MVector3 position; - /// /// The radius of this volume. /// [DefaultValue(1f)] public float radius = 1f; - - /// - /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). - /// - public string parentPath; - - /// - /// Whether the positional coordinates are relative to parent instead of the root planet object. - /// - public bool isRelativeToParent; - - /// - /// An optional rename of this volume. - /// - public string rename; } [JsonObject]