mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add relative to parent option (#349)
Minor Features: - Adds `isRelativeToParent` to allow applying position and rotation relative to the parent defined by `parentPath`. Applies to details, dialogue, Nomai text, slides, whiteboards, projection pools, projection stones, and signals.
This commit is contained in:
commit
5f71b64943
@ -196,6 +196,22 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (detail.isRelativeToParent)
|
||||||
|
{
|
||||||
|
prop.transform.localPosition = detail.position == null ? Vector3.zero : detail.position;
|
||||||
|
if (detail.alignToNormal)
|
||||||
|
{
|
||||||
|
// Apply the rotation after aligning it with normal
|
||||||
|
var up = (prop.transform.position - go.transform.position).normalized;
|
||||||
|
prop.transform.rotation = Quaternion.FromToRotation(Vector3.up, up);
|
||||||
|
prop.transform.rotation *= rot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prop.transform.localRotation = rot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (isItem)
|
if (isItem)
|
||||||
{
|
{
|
||||||
// Else when you put them down you can't pick them back up
|
// Else when you put them down you can't pick them back up
|
||||||
|
|||||||
@ -128,12 +128,19 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
conversationZone.transform.parent = sector?.transform ?? planetGO.transform;
|
conversationZone.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.pathToAnimController))
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
|
{
|
||||||
|
conversationZone.transform.parent = planetGO.transform.Find(info.parentPath);
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrEmpty(info.pathToAnimController))
|
||||||
{
|
{
|
||||||
conversationZone.transform.parent = planetGO.transform.Find(info.pathToAnimController);
|
conversationZone.transform.parent = planetGO.transform.Find(info.pathToAnimController);
|
||||||
}
|
}
|
||||||
|
|
||||||
conversationZone.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
|
if (info.isRelativeToParent) conversationZone.transform.localPosition = pos;
|
||||||
|
else conversationZone.transform.position = planetGO.transform.TransformPoint(pos);
|
||||||
|
|
||||||
conversationZone.SetActive(true);
|
conversationZone.SetActive(true);
|
||||||
|
|
||||||
return dialogueTree;
|
return dialogueTree;
|
||||||
|
|||||||
@ -163,19 +163,40 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nomaiWallTextObj.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
if (info.normal != null)
|
if (info.isRelativeToParent)
|
||||||
{
|
{
|
||||||
// In global coordinates (normal was in local coordinates)
|
nomaiWallTextObj.transform.localPosition = pos;
|
||||||
var up = (nomaiWallTextObj.transform.position - planetGO.transform.position).normalized;
|
if (info.normal != null)
|
||||||
var forward = planetGO.transform.TransformDirection(info.normal).normalized;
|
{
|
||||||
|
// 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.up = up;
|
||||||
nomaiWallTextObj.transform.forward = forward;
|
nomaiWallTextObj.transform.forward = forward;
|
||||||
|
}
|
||||||
|
if (info.rotation != null)
|
||||||
|
{
|
||||||
|
nomaiWallTextObj.transform.localRotation = Quaternion.Euler(info.rotation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (info.rotation != null)
|
else
|
||||||
{
|
{
|
||||||
nomaiWallTextObj.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation));
|
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.up = up;
|
||||||
|
nomaiWallTextObj.transform.forward = forward;
|
||||||
|
}
|
||||||
|
if (info.rotation != null)
|
||||||
|
{
|
||||||
|
nomaiWallTextObj.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nomaiWallTextObj.SetActive(true);
|
nomaiWallTextObj.SetActive(true);
|
||||||
@ -238,7 +259,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customScroll.transform.position = planetGO.transform.TransformPoint(info.position ?? Vector3.zero);
|
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;
|
var up = planetGO.transform.InverseTransformPoint(customScroll.transform.position).normalized;
|
||||||
customScroll.transform.rotation = Quaternion.FromToRotation(customScroll.transform.up, up) * customScroll.transform.rotation;
|
customScroll.transform.rotation = Quaternion.FromToRotation(customScroll.transform.up, up) * customScroll.transform.rotation;
|
||||||
@ -291,7 +314,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
computerObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
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;
|
var up = computerObject.transform.position - planetGO.transform.position;
|
||||||
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
||||||
@ -318,29 +343,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
var detailInfo = new PropModule.DetailInfo()
|
var detailInfo = new PropModule.DetailInfo()
|
||||||
{
|
{
|
||||||
position = info.position
|
position = info.position,
|
||||||
|
parentPath = info.parentPath,
|
||||||
|
isRelativeToParent = info.isRelativeToParent,
|
||||||
|
rename = info.rename
|
||||||
};
|
};
|
||||||
var computerObject = DetailBuilder.Make(planetGO, sector, _preCrashComputerPrefab, detailInfo);
|
var computerObject = DetailBuilder.Make(planetGO, sector, _preCrashComputerPrefab, detailInfo);
|
||||||
computerObject.SetActive(false);
|
computerObject.SetActive(false);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.rename))
|
|
||||||
{
|
|
||||||
computerObject.name = info.rename;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
|
||||||
{
|
|
||||||
var newParent = planetGO.transform.Find(info.parentPath);
|
|
||||||
if (newParent != null)
|
|
||||||
{
|
|
||||||
computerObject.transform.SetParent(newParent, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var up = computerObject.transform.position - planetGO.transform.position;
|
var up = computerObject.transform.position - planetGO.transform.position;
|
||||||
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
||||||
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
||||||
@ -407,11 +417,15 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cairnObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
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)
|
if (info.rotation != null)
|
||||||
{
|
{
|
||||||
cairnObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation));
|
var rot = Quaternion.Euler(info.rotation);
|
||||||
|
if (info.isRelativeToParent) cairnObject.transform.localRotation = rot;
|
||||||
|
else cairnObject.transform.rotation = planetGO.transform.TransformRotation(rot);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -456,18 +470,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
var detailInfo = new PropModule.DetailInfo {
|
var detailInfo = new PropModule.DetailInfo {
|
||||||
parentPath = info.parentPath,
|
parentPath = info.parentPath,
|
||||||
rotation = info.rotation,
|
rotation = info.rotation,
|
||||||
position = info.position
|
position = info.position,
|
||||||
|
isRelativeToParent = info.isRelativeToParent,
|
||||||
|
rename = info.rename
|
||||||
};
|
};
|
||||||
var recorderObject = DetailBuilder.Make(planetGO, sector, prefab, detailInfo);
|
var recorderObject = DetailBuilder.Make(planetGO, sector, prefab, detailInfo);
|
||||||
recorderObject.SetActive(false);
|
recorderObject.SetActive(false);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.rename))
|
|
||||||
{
|
|
||||||
recorderObject.name = info.rename;
|
|
||||||
}
|
|
||||||
|
|
||||||
recorderObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
|
||||||
|
|
||||||
if (info.rotation == null)
|
if (info.rotation == null)
|
||||||
{
|
{
|
||||||
var up = recorderObject.transform.position - planetGO.transform.position;
|
var up = recorderObject.transform.position - planetGO.transform.position;
|
||||||
@ -517,14 +526,18 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trailmarkerObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
|
if (info.isRelativeToParent) trailmarkerObject.transform.localPosition = pos;
|
||||||
|
else trailmarkerObject.transform.position = planetGO.transform.TransformPoint(pos);
|
||||||
|
|
||||||
// shrink because that is what mobius does on all trailmarkers or else they are the size of the player
|
// 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;
|
trailmarkerObject.transform.localScale = Vector3.one * 0.75f;
|
||||||
|
|
||||||
if (info.rotation != null)
|
if (info.rotation != null)
|
||||||
{
|
{
|
||||||
trailmarkerObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(info.rotation));
|
var rot = Quaternion.Euler(info.rotation);
|
||||||
|
if (info.isRelativeToParent) trailmarkerObject.transform.localRotation = rot;
|
||||||
|
else trailmarkerObject.transform.rotation = planetGO.transform.TransformRotation(rot);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -122,8 +122,18 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
slideReelObj.transform.position = planetGO.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
slideReelObj.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
var rot = Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero));
|
||||||
|
if (info.isRelativeToParent)
|
||||||
|
{
|
||||||
|
slideReelObj.transform.localPosition = pos;
|
||||||
|
slideReelObj.transform.localRotation = rot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slideReelObj.transform.position = planetGO.transform.TransformPoint(pos);
|
||||||
|
slideReelObj.transform.rotation = planetGO.transform.TransformRotation(rot);
|
||||||
|
}
|
||||||
|
|
||||||
// Now we replace the slides
|
// Now we replace the slides
|
||||||
int slidesCount = info.slides.Length;
|
int slidesCount = info.slides.Length;
|
||||||
@ -208,8 +218,18 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
autoProjector.transform.position = planetGO.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
autoProjector.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
var rot = Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero));
|
||||||
|
if (info.isRelativeToParent)
|
||||||
|
{
|
||||||
|
autoProjector.transform.localPosition = pos;
|
||||||
|
autoProjector.transform.localRotation = rot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
autoProjector.transform.position = planetGO.transform.TransformPoint(pos);
|
||||||
|
autoProjector.transform.rotation = planetGO.transform.TransformRotation(rot);
|
||||||
|
}
|
||||||
|
|
||||||
// Now we replace the slides
|
// Now we replace the slides
|
||||||
int slidesCount = info.slides.Length;
|
int slidesCount = info.slides.Length;
|
||||||
@ -243,23 +263,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
var detailInfo = new PropModule.DetailInfo()
|
var detailInfo = new PropModule.DetailInfo()
|
||||||
{
|
{
|
||||||
position = info.position,
|
position = info.position,
|
||||||
|
rotation = info.rotation,
|
||||||
|
parentPath = info.parentPath,
|
||||||
|
isRelativeToParent = info.isRelativeToParent,
|
||||||
scale = 2
|
scale = 2
|
||||||
};
|
};
|
||||||
var g = DetailBuilder.Make(planetGO, sector, _visionTorchDetectorPrefab, detailInfo);
|
var g = DetailBuilder.Make(planetGO, sector, _visionTorchDetectorPrefab, detailInfo);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
|
||||||
{
|
|
||||||
var newParent = planetGO.transform.Find(info.parentPath);
|
|
||||||
if (newParent != null)
|
|
||||||
{
|
|
||||||
g.transform.SetParent(newParent, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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?");
|
||||||
@ -300,23 +310,12 @@ namespace NewHorizons.Builder.Props
|
|||||||
var detailInfo = new PropModule.DetailInfo()
|
var detailInfo = new PropModule.DetailInfo()
|
||||||
{
|
{
|
||||||
position = info.position,
|
position = info.position,
|
||||||
rotation = info.rotation
|
rotation = info.rotation,
|
||||||
|
parentPath = info.parentPath,
|
||||||
|
isRelativeToParent = info.isRelativeToParent
|
||||||
};
|
};
|
||||||
var standingTorch = DetailBuilder.Make(planetGO, sector, _standingVisionTorchPrefab, detailInfo);
|
var standingTorch = DetailBuilder.Make(planetGO, sector, _standingVisionTorchPrefab, detailInfo);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
|
||||||
{
|
|
||||||
var newParent = planetGO.transform.Find(info.parentPath);
|
|
||||||
if (newParent != null)
|
|
||||||
{
|
|
||||||
standingTorch.transform.SetParent(newParent, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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?");
|
||||||
|
|||||||
@ -171,31 +171,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
var detailInfo = new PropModule.DetailInfo()
|
var detailInfo = new PropModule.DetailInfo()
|
||||||
{
|
{
|
||||||
position = info.position,
|
position = info.position,
|
||||||
rotation = info.rotation
|
rotation = info.rotation,
|
||||||
|
parentPath = info.parentPath,
|
||||||
|
isRelativeToParent = info.isRelativeToParent,
|
||||||
|
rename = info.rename
|
||||||
};
|
};
|
||||||
var whiteboard = DetailBuilder.Make(go, sector, _whiteboardPrefab, detailInfo);
|
var whiteboard = DetailBuilder.Make(go, sector, _whiteboardPrefab, detailInfo);
|
||||||
whiteboard.SetActive(false);
|
whiteboard.SetActive(false);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.rename))
|
|
||||||
{
|
|
||||||
whiteboard.name = info.rename;
|
|
||||||
}
|
|
||||||
|
|
||||||
whiteboard.transform.parent = sector?.transform ?? go.transform;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
|
||||||
{
|
|
||||||
var newParent = go.transform.Find(info.parentPath);
|
|
||||||
if (newParent != null)
|
|
||||||
{
|
|
||||||
whiteboard.transform.parent = newParent;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.LogWarning($"Cannot find parent object at path: {go.name}/{info.parentPath}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var decalMat = new Material(_decalMaterial);
|
var decalMat = new Material(_decalMaterial);
|
||||||
decalMat.SetTexture("_MainTex", decal);
|
decalMat.SetTexture("_MainTex", decal);
|
||||||
decalMat.SetTexture("_EmissionMap", decal);
|
decalMat.SetTexture("_EmissionMap", decal);
|
||||||
@ -236,31 +219,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
var detailInfo = new PropModule.DetailInfo()
|
var detailInfo = new PropModule.DetailInfo()
|
||||||
{
|
{
|
||||||
position = info.position,
|
position = info.position,
|
||||||
rotation = info.rotation
|
rotation = info.rotation,
|
||||||
|
parentPath = info.parentPath,
|
||||||
|
isRelativeToParent = info.isRelativeToParent,
|
||||||
|
rename = info.rename
|
||||||
};
|
};
|
||||||
var platform = DetailBuilder.Make(go, sector, _remoteCameraPlatformPrefab, detailInfo);
|
var platform = DetailBuilder.Make(go, sector, _remoteCameraPlatformPrefab, detailInfo);
|
||||||
platform.SetActive(false);
|
platform.SetActive(false);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.rename))
|
|
||||||
{
|
|
||||||
platform.name = info.rename;
|
|
||||||
}
|
|
||||||
|
|
||||||
platform.transform.parent = sector?.transform ?? go.transform;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
|
||||||
{
|
|
||||||
var newParent = go.transform.Find(info.parentPath);
|
|
||||||
if (newParent != null)
|
|
||||||
{
|
|
||||||
platform.transform.parent = newParent;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.LogWarning($"Cannot find parent object at path: {go.name}/{info.parentPath}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var decalMat = new Material(_decalMaterial);
|
var decalMat = new Material(_decalMaterial);
|
||||||
decalMat.SetTexture("_MainTex", decal);
|
decalMat.SetTexture("_MainTex", decal);
|
||||||
decalMat.SetTexture("_EmissionMap", decal);
|
decalMat.SetTexture("_EmissionMap", decal);
|
||||||
@ -310,8 +276,18 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shareStone.transform.position = go.transform.TransformPoint((Vector3)(info.position ?? Vector3.zero));
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
shareStone.transform.rotation = go.transform.TransformRotation(Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero)));
|
var rot = Quaternion.Euler((Vector3)(info.rotation ?? Vector3.zero));
|
||||||
|
if (info.isRelativeToParent)
|
||||||
|
{
|
||||||
|
shareStone.transform.localPosition = pos;
|
||||||
|
shareStone.transform.localRotation = rot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shareStone.transform.position = go.transform.TransformPoint(pos);
|
||||||
|
shareStone.transform.rotation = go.transform.TransformRotation(rot);
|
||||||
|
}
|
||||||
|
|
||||||
shareStone.GetComponent<SharedStone>()._connectedPlatform = id;
|
shareStone.GetComponent<SharedStone>()._connectedPlatform = id;
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signalGO.transform.position = planetGO.transform.TransformPoint(info.position != null ? (Vector3)info.position : Vector3.zero);
|
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||||
|
if (info.isRelativeToParent) signalGO.transform.localPosition = pos;
|
||||||
|
else signalGO.transform.position = planetGO.transform.TransformPoint(pos);
|
||||||
signalGO.layer = LayerMask.NameToLayer("AdvancedEffectVolume");
|
signalGO.layer = LayerMask.NameToLayer("AdvancedEffectVolume");
|
||||||
|
|
||||||
var source = signalGO.AddComponent<AudioSource>();
|
var source = signalGO.AddComponent<AudioSource>();
|
||||||
|
|||||||
35
NewHorizons/External/Modules/PropModule.cs
vendored
35
NewHorizons/External/Modules/PropModule.cs
vendored
@ -220,6 +220,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Should this detail stay loaded even if you're outside the sector (good for very large props)
|
/// Should this detail stay loaded even if you're outside the sector (good for very large props)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -451,6 +456,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string xmlFile;
|
public string xmlFile;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to the animation controller instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Optionally rename the dialogue object. The remote trigger volume will be renamed to have this as a prefix.
|
/// Optionally rename the dialogue object. The remote trigger volume will be renamed to have this as a prefix.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -560,6 +570,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An optional rename of this object
|
/// An optional rename of this object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -658,6 +673,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// The relative path from the planet to the parent of this slideshow. Optional (will default to the root sector).
|
/// The relative path from the planet to the parent of this slideshow. Optional (will default to the root sector).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
@ -857,6 +877,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An optional rename of this object
|
/// An optional rename of this object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -920,6 +945,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An optional rename of this object
|
/// An optional rename of this object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -959,6 +989,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An optional rename of this object
|
/// An optional rename of this object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
5
NewHorizons/External/Modules/SignalModule.cs
vendored
5
NewHorizons/External/Modules/SignalModule.cs
vendored
@ -80,6 +80,11 @@ namespace NewHorizons.External.Modules
|
|||||||
/// The relative path from the planet to the parent of this signal. Optional (will default to the root sector).
|
/// The relative path from the planet to the parent of this signal. Optional (will default to the root sector).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether the positional and rotational coordinates are relative to parent instead of the root planet object.
|
||||||
|
/// </summary>
|
||||||
|
public bool isRelativeToParent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1055,6 +1055,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The path (not including the root planet object) of the parent of this game object. Optional (will default to the root sector)."
|
"description": "The path (not including the root planet object) of the parent of this game object. Optional (will default to the root sector)."
|
||||||
},
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
|
},
|
||||||
"keepLoaded": {
|
"keepLoaded": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Should this detail stay loaded even if you're outside the sector (good for very large props)"
|
"description": "Should this detail stay loaded even if you're outside the sector (good for very large props)"
|
||||||
@ -1106,6 +1110,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Relative path to the xml file defining the dialogue."
|
"description": "Relative path to the xml file defining the dialogue."
|
||||||
},
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to the animation controller instead of the root planet object."
|
||||||
|
},
|
||||||
"rename": {
|
"rename": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Optionally rename the dialogue object. The remote trigger volume will be renamed to have this as a prefix."
|
"description": "Optionally rename the dialogue object. The remote trigger volume will be renamed to have this as a prefix."
|
||||||
@ -1236,6 +1244,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||||
},
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
|
},
|
||||||
"rename": {
|
"rename": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "An optional rename of this object"
|
"description": "An optional rename of this object"
|
||||||
@ -1464,6 +1476,10 @@
|
|||||||
"parentPath": {
|
"parentPath": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The relative path from the planet to the parent of this slideshow. Optional (will default to the root sector)."
|
"description": "The relative path from the planet to the parent of this slideshow. Optional (will default to the root sector)."
|
||||||
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1858,6 +1874,10 @@
|
|||||||
"parentPath": {
|
"parentPath": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The relative path from the planet to the parent of this signal. Optional (will default to the root sector)."
|
"description": "The relative path from the planet to the parent of this signal. Optional (will default to the root sector)."
|
||||||
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1913,6 +1933,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||||
},
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
|
},
|
||||||
"rename": {
|
"rename": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "An optional rename of this object"
|
"description": "An optional rename of this object"
|
||||||
@ -1974,6 +1998,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||||
},
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
|
},
|
||||||
"rename": {
|
"rename": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "An optional rename of this object"
|
"description": "An optional rename of this object"
|
||||||
@ -2009,6 +2037,10 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
"description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)."
|
||||||
},
|
},
|
||||||
|
"isRelativeToParent": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object."
|
||||||
|
},
|
||||||
"rename": {
|
"rename": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "An optional rename of this object"
|
"description": "An optional rename of this object"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user