mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add optional parent path to signal info
This commit is contained in:
parent
c7985b9e08
commit
8a00627efd
@ -136,6 +136,12 @@ namespace NewHorizons.Builder.Props
|
||||
var signalGO = new GameObject($"Signal_{info.name}");
|
||||
signalGO.SetActive(false);
|
||||
signalGO.transform.parent = sector?.transform ?? planetGO.transform;
|
||||
|
||||
if (!string.IsNullOrEmpty(info.parentPath))
|
||||
{
|
||||
signalGO.transform.parent = planetGO.transform.Find(info.parentPath);
|
||||
}
|
||||
|
||||
signalGO.transform.position = planetGO.transform.TransformPoint(info.position != null ? (Vector3)info.position : Vector3.zero);
|
||||
signalGO.layer = LayerMask.NameToLayer("AdvancedEffectVolume");
|
||||
|
||||
|
||||
5
NewHorizons/External/Modules/SignalModule.cs
vendored
5
NewHorizons/External/Modules/SignalModule.cs
vendored
@ -75,6 +75,11 @@ namespace NewHorizons.External.Modules
|
||||
/// Radius of the sphere giving off the signal.
|
||||
/// </summary>
|
||||
[DefaultValue(1f)] public float sourceRadius = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// The relative path from the planet to the parent of this signal. Optional (will default to the root sector).
|
||||
/// </summary>
|
||||
public string parentPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user