mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add IModBehavior params to detail builder and hierarchy
This commit is contained in:
parent
ee154fdb33
commit
358f130c0d
@ -6,6 +6,7 @@ using NewHorizons.External.Modules;
|
|||||||
using NewHorizons.External.Modules.Props;
|
using NewHorizons.External.Modules.Props;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using NewHorizons.Utility.OWML;
|
using NewHorizons.Utility.OWML;
|
||||||
|
using OWML.Common;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -80,7 +81,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
if (_wallCollision == null) _wallCollision = Main.NHPrivateAssetBundle.LoadAsset<GameObject>("BrambleCollision");
|
if (_wallCollision == null) _wallCollision = Main.NHPrivateAssetBundle.LoadAsset<GameObject>("BrambleCollision");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameObject Make(NewHorizonsBody body, GameObject go, NHAstroObject ao, Sector sector, OWRigidbody owRigidBody)
|
public static GameObject Make(NewHorizonsBody body, GameObject go, NHAstroObject ao, Sector sector, IModBehaviour mod, OWRigidbody owRigidBody)
|
||||||
{
|
{
|
||||||
InitPrefabs();
|
InitPrefabs();
|
||||||
|
|
||||||
@ -102,7 +103,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
default: geometryPrefab = _hubGeometry; break;
|
default: geometryPrefab = _hubGeometry; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var geometry = DetailBuilder.Make(go, sector, geometryPrefab, new DetailInfo());
|
var geometry = DetailBuilder.Make(go, sector, mod, geometryPrefab, new DetailInfo());
|
||||||
|
|
||||||
var exitWarps = _exitWarps.InstantiateInactive();
|
var exitWarps = _exitWarps.InstantiateInactive();
|
||||||
var repelVolume = _repelVolume.InstantiateInactive();
|
var repelVolume = _repelVolume.InstantiateInactive();
|
||||||
|
|||||||
@ -52,24 +52,16 @@ namespace NewHorizons.Builder.Props
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a detail using an asset bundle or a path in the scene hierarchy of the item to copy.
|
/// Create a detail using an asset bundle or a path in the scene hierarchy of the item to copy.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static GameObject Make(GameObject go, Sector sector, IModBehaviour mod, DetailInfo detail)
|
public static GameObject Make(GameObject planetGO, Sector sector, IModBehaviour mod, DetailInfo info)
|
||||||
{
|
{
|
||||||
if (detail.assetBundle != null)
|
if (info.assetBundle != null)
|
||||||
{
|
{
|
||||||
// Shouldn't happen
|
// Shouldn't happen
|
||||||
if (mod == null) return null;
|
if (mod == null) return null;
|
||||||
|
|
||||||
return Make(go, sector, AssetBundleUtilities.LoadPrefab(detail.assetBundle, detail.path, mod), detail);
|
return Make(planetGO, sector, mod, AssetBundleUtilities.LoadPrefab(info.assetBundle, info.path, mod), info);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return Make(go, sector, detail);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create a detail using a path in the scene hierarchy of the item to copy.
|
|
||||||
/// </summary>
|
|
||||||
public static GameObject Make(GameObject planetGO, Sector sector, DetailInfo info)
|
|
||||||
{
|
|
||||||
if (_emptyPrefab == null) _emptyPrefab = new GameObject("Empty");
|
if (_emptyPrefab == null) _emptyPrefab = new GameObject("Empty");
|
||||||
|
|
||||||
// Allow for empty game objects so you can set up conditional activation on them and parent other props to them
|
// Allow for empty game objects so you can set up conditional activation on them and parent other props to them
|
||||||
@ -82,14 +74,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Make(planetGO, sector, prefab, info);
|
return Make(planetGO, sector, mod, prefab, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a detail using a prefab.
|
/// Create a detail using a prefab.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static GameObject Make(GameObject go, Sector sector, GameObject prefab, DetailInfo detail)
|
public static GameObject Make(GameObject go, Sector sector, IModBehaviour mod, GameObject prefab, DetailInfo detail)
|
||||||
{
|
{
|
||||||
if (prefab == null) return null;
|
if (prefab == null) return null;
|
||||||
|
|
||||||
@ -165,7 +157,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
if (detail.item != null)
|
if (detail.item != null)
|
||||||
{
|
{
|
||||||
ItemBuilder.MakeItem(prop, go, sector, detail.item);
|
ItemBuilder.MakeItem(prop, go, sector, detail.item, mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detail.itemSocket != null)
|
if (detail.itemSocket != null)
|
||||||
|
|||||||
@ -76,7 +76,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
if (_interfacePrefab == null || planetGO == null || sector == null || _detailedPlatformPrefab == null || _platformPrefab == null || _orbPrefab == null) return null;
|
if (_interfacePrefab == null || planetGO == null || sector == null || _detailedPlatformPrefab == null || _platformPrefab == null || _orbPrefab == null) return null;
|
||||||
|
|
||||||
var detailInfo = new DetailInfo(info.controls) { keepLoaded = true };
|
var detailInfo = new DetailInfo(info.controls) { keepLoaded = true };
|
||||||
var gravityCannonObject = DetailBuilder.Make(planetGO, sector, _interfacePrefab, detailInfo);
|
var gravityCannonObject = DetailBuilder.Make(planetGO, sector, mod, _interfacePrefab, detailInfo);
|
||||||
gravityCannonObject.SetActive(false);
|
gravityCannonObject.SetActive(false);
|
||||||
|
|
||||||
var gravityCannonController = gravityCannonObject.GetComponent<GravityCannonController>();
|
var gravityCannonController = gravityCannonObject.GetComponent<GravityCannonController>();
|
||||||
@ -87,7 +87,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
gravityCannonController._retrieveShipLogFact = info.retrieveReveal ?? string.Empty;
|
gravityCannonController._retrieveShipLogFact = info.retrieveReveal ?? string.Empty;
|
||||||
gravityCannonController._launchShipLogFact = info.launchReveal ?? string.Empty;
|
gravityCannonController._launchShipLogFact = info.launchReveal ?? string.Empty;
|
||||||
|
|
||||||
CreatePlatform(planetGO, sector, gravityCannonController, info);
|
CreatePlatform(planetGO, sector, mod, gravityCannonController, info);
|
||||||
|
|
||||||
if (info.computer != null)
|
if (info.computer != null)
|
||||||
{
|
{
|
||||||
@ -175,9 +175,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
return computer;
|
return computer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static GameObject CreatePlatform(GameObject planetGO, Sector sector, GravityCannonController gravityCannonController, GravityCannonInfo platformInfo)
|
private static GameObject CreatePlatform(GameObject planetGO, Sector sector, IModBehaviour mod, GravityCannonController gravityCannonController, GravityCannonInfo platformInfo)
|
||||||
{
|
{
|
||||||
var platform = DetailBuilder.Make(planetGO, sector, platformInfo.detailed ? _detailedPlatformPrefab : _platformPrefab, new DetailInfo(platformInfo) { keepLoaded = true });
|
var platform = DetailBuilder.Make(planetGO, sector, mod, platformInfo.detailed ? _detailedPlatformPrefab : _platformPrefab, new DetailInfo(platformInfo) { keepLoaded = true });
|
||||||
|
|
||||||
gravityCannonController._forceVolume = platform.FindChild("ForceVolume").GetComponent<DirectionalForceVolume>();
|
gravityCannonController._forceVolume = platform.FindChild("ForceVolume").GetComponent<DirectionalForceVolume>();
|
||||||
gravityCannonController._platformTrigger = platform.FindChild("PlatformTrigger").GetComponent<OWTriggerVolume>();
|
gravityCannonController._platformTrigger = platform.FindChild("PlatformTrigger").GetComponent<OWTriggerVolume>();
|
||||||
|
|||||||
@ -376,7 +376,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
case NomaiTextType.PreCrashComputer:
|
case NomaiTextType.PreCrashComputer:
|
||||||
{
|
{
|
||||||
var computerObject = DetailBuilder.Make(planetGO, sector, _preCrashComputerPrefab, new DetailInfo(info));
|
var computerObject = DetailBuilder.Make(planetGO, sector, mod, _preCrashComputerPrefab, new DetailInfo(info));
|
||||||
computerObject.SetActive(false);
|
computerObject.SetActive(false);
|
||||||
|
|
||||||
var up = computerObject.transform.position - planetGO.transform.position;
|
var up = computerObject.transform.position - planetGO.transform.position;
|
||||||
@ -493,7 +493,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
case NomaiTextType.Recorder:
|
case NomaiTextType.Recorder:
|
||||||
{
|
{
|
||||||
var prefab = (info.type == NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab);
|
var prefab = (info.type == NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab);
|
||||||
var recorderObject = DetailBuilder.Make(planetGO, sector, prefab, new DetailInfo(info));
|
var recorderObject = DetailBuilder.Make(planetGO, sector, mod, prefab, new DetailInfo(info));
|
||||||
recorderObject.SetActive(false);
|
recorderObject.SetActive(false);
|
||||||
|
|
||||||
if (info.rotation == null)
|
if (info.rotation == null)
|
||||||
|
|||||||
@ -203,7 +203,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
if (_visionTorchDetectorPrefab == null) return null;
|
if (_visionTorchDetectorPrefab == null) return null;
|
||||||
|
|
||||||
// spawn a trigger for the vision torch
|
// spawn a trigger for the vision torch
|
||||||
var g = DetailBuilder.Make(planetGO, sector, _visionTorchDetectorPrefab, new DetailInfo(info) { scale = 2, rename = !string.IsNullOrEmpty(info.rename) ? info.rename : "VisionStaffDetector" });
|
var g = DetailBuilder.Make(planetGO, sector, mod, _visionTorchDetectorPrefab, new DetailInfo(info) { scale = 2, rename = !string.IsNullOrEmpty(info.rename) ? info.rename : "VisionStaffDetector" });
|
||||||
|
|
||||||
if (g == null)
|
if (g == null)
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
if (_standingVisionTorchPrefab == null) return null;
|
if (_standingVisionTorchPrefab == null) return null;
|
||||||
|
|
||||||
// Spawn the torch itself
|
// Spawn the torch itself
|
||||||
var standingTorch = DetailBuilder.Make(planetGO, sector, _standingVisionTorchPrefab, new DetailInfo(info));
|
var standingTorch = DetailBuilder.Make(planetGO, sector, mod, _standingVisionTorchPrefab, new DetailInfo(info));
|
||||||
|
|
||||||
if (standingTorch == null)
|
if (standingTorch == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,7 +39,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ShuttleBuilder.Make(go, sector, shuttleInfo);
|
ShuttleBuilder.Make(go, sector, nhBody.Mod, shuttleInfo);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -283,7 +283,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WarpPadBuilder.Make(go, sector, warpReceiver);
|
WarpPadBuilder.Make(go, sector, nhBody.Mod, warpReceiver);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -297,7 +297,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
WarpPadBuilder.Make(go, sector, warpTransmitter);
|
WarpPadBuilder.Make(go, sector, nhBody.Mod, warpTransmitter);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -149,7 +149,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MakeWhiteboard(go, sector, id, decal, info.whiteboard, nhBody);
|
MakeWhiteboard(go, sector, nhBody.Mod, id, decal, info.whiteboard, nhBody);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -173,9 +173,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MakeWhiteboard(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, RemoteWhiteboardInfo info, NewHorizonsBody nhBody)
|
public static void MakeWhiteboard(GameObject go, Sector sector, IModBehaviour mod, NomaiRemoteCameraPlatform.ID id, Texture2D decal, RemoteWhiteboardInfo info, NewHorizonsBody nhBody)
|
||||||
{
|
{
|
||||||
var whiteboard = DetailBuilder.Make(go, sector, _whiteboardPrefab, new DetailInfo(info));
|
var whiteboard = DetailBuilder.Make(go, sector, mod, _whiteboardPrefab, new DetailInfo(info));
|
||||||
whiteboard.SetActive(false);
|
whiteboard.SetActive(false);
|
||||||
|
|
||||||
var decalMat = new Material(_decalMaterial);
|
var decalMat = new Material(_decalMaterial);
|
||||||
@ -215,7 +215,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
public static void MakePlatform(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, PlatformInfo info, IModBehaviour mod)
|
public static void MakePlatform(GameObject go, Sector sector, NomaiRemoteCameraPlatform.ID id, Texture2D decal, PlatformInfo info, IModBehaviour mod)
|
||||||
{
|
{
|
||||||
var platform = DetailBuilder.Make(go, sector, _remoteCameraPlatformPrefab, new DetailInfo(info));
|
var platform = DetailBuilder.Make(go, sector, mod, _remoteCameraPlatformPrefab, new DetailInfo(info));
|
||||||
platform.SetActive(false);
|
platform.SetActive(false);
|
||||||
|
|
||||||
var decalMat = new Material(_decalMaterial);
|
var decalMat = new Material(_decalMaterial);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
stretch = propInfo.stretch,
|
stretch = propInfo.stretch,
|
||||||
keepLoaded = propInfo.keepLoaded
|
keepLoaded = propInfo.keepLoaded
|
||||||
};
|
};
|
||||||
var scatterPrefab = DetailBuilder.Make(go, sector, prefab, detailInfo);
|
var scatterPrefab = DetailBuilder.Make(go, sector, mod, prefab, detailInfo);
|
||||||
|
|
||||||
for (int i = 0; i < propInfo.count; i++)
|
for (int i = 0; i < propInfo.count; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using NewHorizons.External.Modules.Props;
|
|||||||
using NewHorizons.External.Modules.Props.Shuttle;
|
using NewHorizons.External.Modules.Props.Shuttle;
|
||||||
using NewHorizons.Handlers;
|
using NewHorizons.Handlers;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
|
using OWML.Common;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -69,14 +70,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameObject Make(GameObject planetGO, Sector sector, ShuttleInfo info)
|
public static GameObject Make(GameObject planetGO, Sector sector, IModBehaviour mod, ShuttleInfo info)
|
||||||
{
|
{
|
||||||
InitPrefab();
|
InitPrefab();
|
||||||
|
|
||||||
if (_prefab == null || planetGO == null || sector == null) return null;
|
if (_prefab == null || planetGO == null || sector == null) return null;
|
||||||
|
|
||||||
var detailInfo = new DetailInfo(info) { keepLoaded = true };
|
var detailInfo = new DetailInfo(info) { keepLoaded = true };
|
||||||
var shuttleObject = DetailBuilder.Make(planetGO, sector, _prefab, detailInfo);
|
var shuttleObject = DetailBuilder.Make(planetGO, sector, mod, _prefab, detailInfo);
|
||||||
shuttleObject.SetActive(false);
|
shuttleObject.SetActive(false);
|
||||||
|
|
||||||
StreamingHandler.SetUpStreaming(shuttleObject, sector);
|
StreamingHandler.SetUpStreaming(shuttleObject, sector);
|
||||||
|
|||||||
@ -242,7 +242,7 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
|||||||
}
|
}
|
||||||
case NomaiTextType.PreCrashComputer:
|
case NomaiTextType.PreCrashComputer:
|
||||||
{
|
{
|
||||||
var computerObject = DetailBuilder.Make(planetGO, sector, PreCrashComputerPrefab, new DetailInfo(info));
|
var computerObject = DetailBuilder.Make(planetGO, sector, nhBody.Mod, PreCrashComputerPrefab, new DetailInfo(info));
|
||||||
computerObject.SetActive(false);
|
computerObject.SetActive(false);
|
||||||
|
|
||||||
var computer = computerObject.GetComponent<NomaiVesselComputer>();
|
var computer = computerObject.GetComponent<NomaiVesselComputer>();
|
||||||
@ -323,7 +323,7 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
|||||||
case NomaiTextType.Recorder:
|
case NomaiTextType.Recorder:
|
||||||
{
|
{
|
||||||
var prefab = (info.type == NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab);
|
var prefab = (info.type == NomaiTextType.PreCrashRecorder ? _preCrashRecorderPrefab : _recorderPrefab);
|
||||||
var recorderObject = DetailBuilder.Make(planetGO, sector, prefab, new DetailInfo(info));
|
var recorderObject = DetailBuilder.Make(planetGO, sector, nhBody.Mod, prefab, new DetailInfo(info));
|
||||||
recorderObject.SetActive(false);
|
recorderObject.SetActive(false);
|
||||||
|
|
||||||
var nomaiText = recorderObject.GetComponentInChildren<NomaiText>();
|
var nomaiText = recorderObject.GetComponentInChildren<NomaiText>();
|
||||||
@ -373,7 +373,7 @@ namespace NewHorizons.Builder.Props.TranslatorText
|
|||||||
path = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/VisibleFrom_HangingCity/Props_NOM_Whiteboard (1)",
|
path = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District2/Interactables_HangingCity_District2/VisibleFrom_HangingCity/Props_NOM_Whiteboard (1)",
|
||||||
rename = info.rename ?? "Props_NOM_Whiteboard",
|
rename = info.rename ?? "Props_NOM_Whiteboard",
|
||||||
};
|
};
|
||||||
var whiteboardObject = DetailBuilder.Make(planetGO, sector, whiteboardInfo);
|
var whiteboardObject = DetailBuilder.Make(planetGO, sector, nhBody.Mod, whiteboardInfo);
|
||||||
|
|
||||||
// Spawn a scroll and insert it into the whiteboard, but only if text is provided
|
// Spawn a scroll and insert it into the whiteboard, but only if text is provided
|
||||||
if (!string.IsNullOrEmpty(info.xmlFile))
|
if (!string.IsNullOrEmpty(info.xmlFile))
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using NewHorizons.External.Modules.WarpPad;
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using NewHorizons.Utility.OuterWilds;
|
using NewHorizons.Utility.OuterWilds;
|
||||||
using NewHorizons.Utility.OWML;
|
using NewHorizons.Utility.OWML;
|
||||||
|
using OWML.Common;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -86,10 +87,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Make(GameObject planetGO, Sector sector, NomaiWarpReceiverInfo info)
|
public static void Make(GameObject planetGO, Sector sector, IModBehaviour mod, NomaiWarpReceiverInfo info)
|
||||||
{
|
{
|
||||||
var detailInfo = new DetailInfo(info);
|
var detailInfo = new DetailInfo(info);
|
||||||
var receiverObject = DetailBuilder.Make(planetGO, sector, info.detailed ? _detailedReceiverPrefab : _receiverPrefab, detailInfo);
|
var receiverObject = DetailBuilder.Make(planetGO, sector, mod, info.detailed ? _detailedReceiverPrefab : _receiverPrefab, detailInfo);
|
||||||
|
|
||||||
NHLogger.Log($"Position is {detailInfo.position} was {info.position}");
|
NHLogger.Log($"Position is {detailInfo.position} was {info.position}");
|
||||||
|
|
||||||
@ -122,13 +123,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
if (info.computer != null)
|
if (info.computer != null)
|
||||||
{
|
{
|
||||||
CreateComputer(planetGO, sector, info.computer, receiver);
|
CreateComputer(planetGO, sector, mod, info.computer, receiver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Make(GameObject planetGO, Sector sector, NomaiWarpTransmitterInfo info)
|
public static void Make(GameObject planetGO, Sector sector, IModBehaviour mod, NomaiWarpTransmitterInfo info)
|
||||||
{
|
{
|
||||||
var transmitterObject = DetailBuilder.Make(planetGO, sector, _transmitterPrefab, new DetailInfo(info));
|
var transmitterObject = DetailBuilder.Make(planetGO, sector, mod, _transmitterPrefab, new DetailInfo(info));
|
||||||
|
|
||||||
var transmitter = transmitterObject.GetComponentInChildren<NomaiWarpTransmitter>();
|
var transmitter = transmitterObject.GetComponentInChildren<NomaiWarpTransmitter>();
|
||||||
transmitter._frequency = GetFrequency(info.frequency);
|
transmitter._frequency = GetFrequency(info.frequency);
|
||||||
@ -145,9 +146,9 @@ namespace NewHorizons.Builder.Props
|
|||||||
transmitterObject.SetActive(true);
|
transmitterObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CreateComputer(GameObject planetGO, Sector sector, GeneralPropInfo computerInfo, NomaiWarpReceiver receiver)
|
private static void CreateComputer(GameObject planetGO, Sector sector, IModBehaviour mod, GeneralPropInfo computerInfo, NomaiWarpReceiver receiver)
|
||||||
{
|
{
|
||||||
var computerObject = DetailBuilder.Make(planetGO, sector, TranslatorTextBuilder.ComputerPrefab, new DetailInfo(computerInfo));
|
var computerObject = DetailBuilder.Make(planetGO, sector, mod, TranslatorTextBuilder.ComputerPrefab, new DetailInfo(computerInfo));
|
||||||
|
|
||||||
var computer = computerObject.GetComponentInChildren<NomaiComputer>();
|
var computer = computerObject.GetComponentInChildren<NomaiComputer>();
|
||||||
computer.SetSector(sector);
|
computer.SetSector(sector);
|
||||||
|
|||||||
@ -377,7 +377,7 @@ namespace NewHorizons.Handlers
|
|||||||
ao._rootSector = sector;
|
ao._rootSector = sector;
|
||||||
ao._type = AstroObject.Type.None;
|
ao._type = AstroObject.Type.None;
|
||||||
|
|
||||||
BrambleDimensionBuilder.Make(body, go, ao, sector, owRigidBody);
|
BrambleDimensionBuilder.Make(body, go, ao, sector, body.Mod, owRigidBody);
|
||||||
|
|
||||||
go = SharedGenerateBody(body, go, sector, owRigidBody);
|
go = SharedGenerateBody(body, go, sector, owRigidBody);
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,9 @@ namespace NewHorizons
|
|||||||
|
|
||||||
[Obsolete("Create(Dictionary<string, object> config) is deprecated, please use LoadConfigs(IModBehaviour mod) instead")]
|
[Obsolete("Create(Dictionary<string, object> config) is deprecated, please use LoadConfigs(IModBehaviour mod) instead")]
|
||||||
void Create(Dictionary<string, object> config, IModBehaviour mod);
|
void Create(Dictionary<string, object> config, IModBehaviour mod);
|
||||||
|
|
||||||
|
[Obsolete("SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignRadial) is deprecated, please use SpawnObject(IModBehaviour mod, GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignRadial) instead")]
|
||||||
|
GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignWithNormal);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -105,7 +108,7 @@ namespace NewHorizons
|
|||||||
/// Allows you to spawn a copy of a prop by specifying its path.
|
/// Allows you to spawn a copy of a prop by specifying its path.
|
||||||
/// This is the same as using Props->details in a config, but also returns the spawned gameObject to you.
|
/// This is the same as using Props->details in a config, but also returns the spawned gameObject to you.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles,
|
GameObject SpawnObject(IModBehaviour mod, GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles,
|
||||||
float scale, bool alignWithNormal);
|
float scale, bool alignWithNormal);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -70,6 +70,13 @@ namespace NewHorizons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignRadial) is deprecated, please use SpawnObject(IModBehaviour mod, GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, float scale, bool alignRadial) instead")]
|
||||||
|
public GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles,
|
||||||
|
float scale, bool alignRadial)
|
||||||
|
{
|
||||||
|
return SpawnObject(null, planet, sector, propToCopyPath, position, eulerAngles, scale, alignRadial);
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadConfigs(IModBehaviour mod)
|
public void LoadConfigs(IModBehaviour mod)
|
||||||
{
|
{
|
||||||
Main.Instance.LoadConfigs(mod);
|
Main.Instance.LoadConfigs(mod);
|
||||||
@ -170,7 +177,7 @@ namespace NewHorizons
|
|||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles,
|
public GameObject SpawnObject(IModBehaviour mod, GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles,
|
||||||
float scale, bool alignRadial)
|
float scale, bool alignRadial)
|
||||||
{
|
{
|
||||||
var prefab = SearchUtilities.Find(propToCopyPath);
|
var prefab = SearchUtilities.Find(propToCopyPath);
|
||||||
@ -181,7 +188,7 @@ namespace NewHorizons
|
|||||||
scale = scale,
|
scale = scale,
|
||||||
alignRadial = alignRadial
|
alignRadial = alignRadial
|
||||||
};
|
};
|
||||||
return DetailBuilder.Make(planet, sector, prefab, detailInfo);
|
return DetailBuilder.Make(planet, sector, mod, prefab, detailInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioSignal SpawnSignal(IModBehaviour mod, GameObject root, string audio, string name, string frequency,
|
public AudioSignal SpawnSignal(IModBehaviour mod, GameObject root, string audio, string name, string frequency,
|
||||||
|
|||||||
@ -157,7 +157,7 @@ namespace NewHorizons.Utility.DebugTools
|
|||||||
position = data.pos,
|
position = data.pos,
|
||||||
rotation = data.rot.eulerAngles,
|
rotation = data.rot.eulerAngles,
|
||||||
};
|
};
|
||||||
var prop = DetailBuilder.Make(planetGO, sector, prefab, detailInfo);
|
var prop = DetailBuilder.Make(planetGO, sector, null, prefab, detailInfo);
|
||||||
|
|
||||||
var body = data.hitBodyGameObject.GetComponent<AstroObject>();
|
var body = data.hitBodyGameObject.GetComponent<AstroObject>();
|
||||||
if (body != null) RegisterProp(body, prop);
|
if (body != null) RegisterProp(body, prop);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user