mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add optional rename to nomai text info
This commit is contained in:
parent
0e9db06e21
commit
099240c87e
@ -110,6 +110,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
var nomaiWallTextObj = MakeWallText(planetGO, sector, info, xmlPath).gameObject;
|
var nomaiWallTextObj = MakeWallText(planetGO, sector, info, xmlPath).gameObject;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
|
{
|
||||||
|
nomaiWallTextObj.name = info.rename;
|
||||||
|
}
|
||||||
|
|
||||||
nomaiWallTextObj.transform.parent = sector?.transform ?? planetGO.transform;
|
nomaiWallTextObj.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
@ -141,6 +146,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
var customScroll = _scrollPrefab.InstantiateInactive();
|
var customScroll = _scrollPrefab.InstantiateInactive();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
|
{
|
||||||
|
customScroll.name = info.rename;
|
||||||
|
}
|
||||||
|
|
||||||
var nomaiWallText = MakeWallText(planetGO, sector, info, xmlPath);
|
var nomaiWallText = MakeWallText(planetGO, sector, info, xmlPath);
|
||||||
nomaiWallText.transform.parent = customScroll.transform;
|
nomaiWallText.transform.parent = customScroll.transform;
|
||||||
nomaiWallText.transform.localPosition = Vector3.zero;
|
nomaiWallText.transform.localPosition = Vector3.zero;
|
||||||
@ -204,6 +214,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
var computerObject = _computerPrefab.InstantiateInactive();
|
var computerObject = _computerPrefab.InstantiateInactive();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
|
{
|
||||||
|
computerObject.name = info.rename;
|
||||||
|
}
|
||||||
|
|
||||||
computerObject.transform.parent = sector?.transform ?? planetGO.transform;
|
computerObject.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
@ -238,6 +253,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
var computerObject = DetailBuilder.MakeDetail(planetGO, sector, _preCrashComputerPrefab, info.position, Vector3.zero, 1, false);
|
var computerObject = DetailBuilder.MakeDetail(planetGO, sector, _preCrashComputerPrefab, info.position, Vector3.zero, 1, false);
|
||||||
computerObject.SetActive(false);
|
computerObject.SetActive(false);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
|
{
|
||||||
|
computerObject.name = info.rename;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
{
|
{
|
||||||
computerObject.transform.SetParent(planetGO.transform.Find(info.parentPath), true);
|
computerObject.transform.SetParent(planetGO.transform.Find(info.parentPath), true);
|
||||||
@ -278,6 +298,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
var cairnObject = _cairnPrefab.InstantiateInactive();
|
var cairnObject = _cairnPrefab.InstantiateInactive();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
|
{
|
||||||
|
cairnObject.name = info.rename;
|
||||||
|
}
|
||||||
|
|
||||||
cairnObject.transform.parent = sector?.transform ?? planetGO.transform;
|
cairnObject.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
@ -331,6 +356,11 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
var recorderObject = (info.type == PropModule.NomaiTextInfo.NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab).InstantiateInactive();
|
var recorderObject = (info.type == PropModule.NomaiTextInfo.NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab).InstantiateInactive();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
|
{
|
||||||
|
recorderObject.name = info.rename;
|
||||||
|
}
|
||||||
|
|
||||||
recorderObject.transform.parent = sector?.transform ?? planetGO.transform;
|
recorderObject.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.parentPath))
|
if (!string.IsNullOrEmpty(info.parentPath))
|
||||||
|
|||||||
6
NewHorizons/External/Modules/PropModule.cs
vendored
6
NewHorizons/External/Modules/PropModule.cs
vendored
@ -517,6 +517,12 @@ namespace NewHorizons.External.Modules
|
|||||||
/// The relative path from the planet to the parent of this object. Optional (will default to the root sector).
|
/// The relative path from the planet to the parent of this object. Optional (will default to the root sector).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string parentPath;
|
public string parentPath;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// An optional rename of this object
|
||||||
|
/// </summary>
|
||||||
|
public string rename;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user