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 projection info
This commit is contained in:
parent
a28542ea2d
commit
1f43af4807
@ -65,6 +65,12 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
|
|
||||||
slideReelObj.transform.parent = sector?.transform ?? planetGO.transform;
|
slideReelObj.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
|
{
|
||||||
|
slideReelObj.transform.parent = planetGO.transform.Find(info.parentPath);
|
||||||
|
}
|
||||||
|
|
||||||
slideReelObj.transform.position = planetGO.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
slideReelObj.transform.position = planetGO.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
||||||
slideReelObj.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
slideReelObj.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
||||||
|
|
||||||
@ -156,6 +162,12 @@ namespace NewHorizons.Builder.Props
|
|||||||
var slideCollectionContainer = autoProjector.GetRequiredComponent<SlideCollectionContainer>();
|
var slideCollectionContainer = autoProjector.GetRequiredComponent<SlideCollectionContainer>();
|
||||||
|
|
||||||
autoProjector.transform.parent = sector?.transform ?? planetGO.transform;
|
autoProjector.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
|
{
|
||||||
|
autoProjector.transform.parent = planetGO.transform.Find(info.parentPath);
|
||||||
|
}
|
||||||
|
|
||||||
autoProjector.transform.position = planetGO.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
autoProjector.transform.position = planetGO.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
||||||
autoProjector.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
autoProjector.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
||||||
|
|
||||||
@ -196,6 +208,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
var path = "DreamWorld_Body/Sector_DreamWorld/Sector_Underground/Sector_PrisonCell/Ghosts_PrisonCell/GhostNodeMap_PrisonCell_Lower/Prefab_IP_GhostBird_Prisoner/Ghostbird_IP_ANIM/Ghostbird_Skin_01:Ghostbird_Rig_V01:Base/Ghostbird_Skin_01:Ghostbird_Rig_V01:Root/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine01/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine02/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine03/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine04/Ghostbird_Skin_01:Ghostbird_Rig_V01:Neck01/Ghostbird_Skin_01:Ghostbird_Rig_V01:Neck02/Ghostbird_Skin_01:Ghostbird_Rig_V01:Head/PrisonerHeadDetector";
|
var path = "DreamWorld_Body/Sector_DreamWorld/Sector_Underground/Sector_PrisonCell/Ghosts_PrisonCell/GhostNodeMap_PrisonCell_Lower/Prefab_IP_GhostBird_Prisoner/Ghostbird_IP_ANIM/Ghostbird_Skin_01:Ghostbird_Rig_V01:Base/Ghostbird_Skin_01:Ghostbird_Rig_V01:Root/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine01/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine02/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine03/Ghostbird_Skin_01:Ghostbird_Rig_V01:Spine04/Ghostbird_Skin_01:Ghostbird_Rig_V01:Neck01/Ghostbird_Skin_01:Ghostbird_Rig_V01:Neck02/Ghostbird_Skin_01:Ghostbird_Rig_V01:Head/PrisonerHeadDetector";
|
||||||
var g = DetailBuilder.MakeDetail(planetGO, sector, path, info.position, Vector3.zero, 2, false);
|
var g = DetailBuilder.MakeDetail(planetGO, sector, path, info.position, Vector3.zero, 2, false);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
|
{
|
||||||
|
g.transform.SetParent(planetGO.transform.Find(info.parentPath), true);
|
||||||
|
}
|
||||||
|
|
||||||
if (g == null)
|
if (g == null)
|
||||||
{
|
{
|
||||||
Logger.LogWarning($"Tried to make a vision torch target but couldn't. Do you have the DLC installed?");
|
Logger.LogWarning($"Tried to make a vision torch target but couldn't. Do you have the DLC installed?");
|
||||||
@ -224,8 +241,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
imageLoader.imageLoadedEvent.AddListener((Texture2D tex, int index) => { slideCollection.slides[index]._image = tex; });
|
imageLoader.imageLoadedEvent.AddListener((Texture2D tex, int index) => { slideCollection.slides[index]._image = tex; });
|
||||||
|
|
||||||
|
// attach a component to store all the data for the slides that play when a vision torch scans this target
|
||||||
// attatch a component to store all the data for the slides that play when a vision torch scans this target
|
|
||||||
var target = g.AddComponent<VisionTorchTarget>();
|
var target = g.AddComponent<VisionTorchTarget>();
|
||||||
var slideCollectionContainer = g.AddComponent<SlideCollectionContainer>();
|
var slideCollectionContainer = g.AddComponent<SlideCollectionContainer>();
|
||||||
slideCollectionContainer.slideCollection = slideCollection;
|
slideCollectionContainer.slideCollection = slideCollection;
|
||||||
@ -247,6 +263,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
var path = "RingWorld_Body/Sector_RingWorld/Sector_SecretEntrance/Interactibles_SecretEntrance/Experiment_1/VisionTorchApparatus/VisionTorchRoot/Prefab_IP_VisionTorchProjector";
|
var path = "RingWorld_Body/Sector_RingWorld/Sector_SecretEntrance/Interactibles_SecretEntrance/Experiment_1/VisionTorchApparatus/VisionTorchRoot/Prefab_IP_VisionTorchProjector";
|
||||||
var standingTorch = DetailBuilder.MakeDetail(planetGO, sector, path, info.position, info.rotation, 1, false);
|
var standingTorch = DetailBuilder.MakeDetail(planetGO, sector, path, info.position, info.rotation, 1, false);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
|
{
|
||||||
|
standingTorch.transform.SetParent(planetGO.transform.Find(info.parentPath), true);
|
||||||
|
}
|
||||||
|
|
||||||
if (standingTorch == null)
|
if (standingTorch == null)
|
||||||
{
|
{
|
||||||
Logger.LogWarning($"Tried to make a vision torch target but couldn't. Do you have the DLC installed?");
|
Logger.LogWarning($"Tried to make a vision torch target but couldn't. Do you have the DLC installed?");
|
||||||
|
|||||||
5
NewHorizons/External/Modules/PropModule.cs
vendored
5
NewHorizons/External/Modules/PropModule.cs
vendored
@ -604,6 +604,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// The type of object this is.
|
/// The type of object this is.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue("slideReel")] public SlideShowType type = SlideShowType.SlideReel;
|
[DefaultValue("slideReel")] public SlideShowType type = SlideShowType.SlideReel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The relative path from the planet to the parent of this slideshow. Optional (will default to the root sector).
|
||||||
|
/// </summary>
|
||||||
|
public string parentPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user