Add rename option to volumes (#355)

This commit is contained in:
Noah 2022-09-05 23:40:53 -04:00 committed by GitHub
commit 8ce864812e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 50 additions and 0 deletions

View File

@ -42,6 +42,11 @@ namespace NewHorizons.Builder.ShipLog
revealTriggerVolume.SetActive(false); revealTriggerVolume.SetActive(false);
revealTriggerVolume.transform.parent = sector?.transform ?? planetGO.transform; revealTriggerVolume.transform.parent = sector?.transform ?? planetGO.transform;
if (!string.IsNullOrEmpty(info.rename))
{
revealTriggerVolume.name = info.rename;
}
if (!string.IsNullOrEmpty(info.parentPath)) if (!string.IsNullOrEmpty(info.parentPath))
{ {
var newParent = planetGO.transform.Find(info.parentPath); var newParent = planetGO.transform.Find(info.parentPath);

View File

@ -20,6 +20,11 @@ namespace NewHorizons.Builder.Volumes
go.transform.parent = sector?.transform ?? planetGO.transform; go.transform.parent = sector?.transform ?? planetGO.transform;
if (!string.IsNullOrEmpty(info.rename))
{
go.name = info.rename;
}
if (!string.IsNullOrEmpty(info.parentPath)) if (!string.IsNullOrEmpty(info.parentPath))
{ {
var newParent = planetGO.transform.Find(info.parentPath); var newParent = planetGO.transform.Find(info.parentPath);

View File

@ -18,6 +18,11 @@ namespace NewHorizons.Builder.Volumes
go.transform.parent = sector?.transform ?? planetGO.transform; go.transform.parent = sector?.transform ?? planetGO.transform;
if (!string.IsNullOrEmpty(info.rename))
{
go.name = info.rename;
}
if (!string.IsNullOrEmpty(info.parentPath)) if (!string.IsNullOrEmpty(info.parentPath))
{ {
var newParent = planetGO.transform.Find(info.parentPath); var newParent = planetGO.transform.Find(info.parentPath);

View File

@ -22,6 +22,11 @@ namespace NewHorizons.Builder.Volumes
go.transform.parent = sector?.transform ?? planetGO.transform; go.transform.parent = sector?.transform ?? planetGO.transform;
if (!string.IsNullOrEmpty(info.rename))
{
go.name = info.rename;
}
if (!string.IsNullOrEmpty(info.parentPath)) if (!string.IsNullOrEmpty(info.parentPath))
{ {
var newParent = planetGO.transform.Find(info.parentPath); var newParent = planetGO.transform.Find(info.parentPath);

View File

@ -14,6 +14,11 @@ namespace NewHorizons.Builder.Volumes
go.transform.parent = sector?.transform ?? planetGO.transform; go.transform.parent = sector?.transform ?? planetGO.transform;
if (!string.IsNullOrEmpty(info.rename))
{
go.name = info.rename;
}
if (!string.IsNullOrEmpty(info.parentPath)) if (!string.IsNullOrEmpty(info.parentPath))
{ {
var newParent = planetGO.transform.Find(info.parentPath); var newParent = planetGO.transform.Find(info.parentPath);

View File

@ -71,6 +71,11 @@ 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 volume.
/// </summary>
public string rename;
} }
[JsonObject] [JsonObject]

View File

@ -2468,6 +2468,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)."
}, },
"rename": {
"type": "string",
"description": "An optional rename of this volume."
},
"audio": { "audio": {
"type": "string", "type": "string",
"description": "The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." "description": "The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list."
@ -2541,6 +2545,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)."
}, },
"rename": {
"type": "string",
"description": "An optional rename of this volume."
},
"type": { "type": {
"description": "The type of hazard for this volume.", "description": "The type of hazard for this volume.",
"default": "general", "default": "general",
@ -2618,6 +2626,10 @@
"parentPath": { "parentPath": {
"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)."
},
"rename": {
"type": "string",
"description": "An optional rename of this volume."
} }
} }
}, },
@ -2638,6 +2650,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)."
}, },
"rename": {
"type": "string",
"description": "An optional rename of this volume."
},
"target": { "target": {
"description": "What the notification will show for.", "description": "What the notification will show for.",
"default": "all", "default": "all",
@ -2700,6 +2716,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)."
}, },
"rename": {
"type": "string",
"description": "An optional rename of this volume."
},
"maxAngle": { "maxAngle": {
"type": "number", "type": "number",
"description": "The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only)", "description": "The max view angle (in degrees) the player can see the volume with to unlock the fact (`observe` only)",