mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Implement vessel computers #242
This commit is contained in:
parent
ce470a60ed
commit
d3eb516b18
@ -18,6 +18,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
private static List<GameObject> _ghostArcPrefabs;
|
private static List<GameObject> _ghostArcPrefabs;
|
||||||
private static GameObject _scrollPrefab;
|
private static GameObject _scrollPrefab;
|
||||||
private static GameObject _computerPrefab;
|
private static GameObject _computerPrefab;
|
||||||
|
private static GameObject _preCrashComputerPrefab;
|
||||||
private static GameObject _cairnPrefab;
|
private static GameObject _cairnPrefab;
|
||||||
private static GameObject _recorderPrefab;
|
private static GameObject _recorderPrefab;
|
||||||
private static GameObject _preCrashRecorderPrefab;
|
private static GameObject _preCrashRecorderPrefab;
|
||||||
@ -80,6 +81,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
_computerPrefab.name = "Prefab_NOM_Computer";
|
_computerPrefab.name = "Prefab_NOM_Computer";
|
||||||
_computerPrefab.transform.rotation = Quaternion.identity;
|
_computerPrefab.transform.rotation = Quaternion.identity;
|
||||||
|
|
||||||
|
_preCrashComputerPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_EscapePodCrashSite/Sector_CrashFragment/EscapePod_Socket/Interactibles_EscapePod/Prefab_NOM_Vessel_Computer").InstantiateInactive();
|
||||||
|
_preCrashComputerPrefab.name = "Prefab_NOM_Vessel_Computer";
|
||||||
|
_preCrashComputerPrefab.transform.rotation = Quaternion.identity;
|
||||||
|
|
||||||
_cairnPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_Crossroads/Interactables_Crossroads/Trailmarkers/Prefab_NOM_BH_Cairn_Arc (1)").InstantiateInactive();
|
_cairnPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_Crossroads/Interactables_Crossroads/Trailmarkers/Prefab_NOM_BH_Cairn_Arc (1)").InstantiateInactive();
|
||||||
_cairnPrefab.name = "Prefab_NOM_Cairn";
|
_cairnPrefab.name = "Prefab_NOM_Cairn";
|
||||||
_cairnPrefab.transform.rotation = Quaternion.identity;
|
_cairnPrefab.transform.rotation = Quaternion.identity;
|
||||||
@ -203,6 +208,35 @@ namespace NewHorizons.Builder.Props
|
|||||||
// Make sure the computer model is loaded
|
// Make sure the computer model is loaded
|
||||||
StreamingHandler.SetUpStreaming(computerObject, sector);
|
StreamingHandler.SetUpStreaming(computerObject, sector);
|
||||||
|
|
||||||
|
computerObject.SetActive(true);
|
||||||
|
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PropModule.NomaiTextInfo.NomaiTextType.PreCrashComputer:
|
||||||
|
{
|
||||||
|
var computerObject = _preCrashComputerPrefab.InstantiateInactive();
|
||||||
|
|
||||||
|
computerObject.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
|
computerObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero);
|
||||||
|
|
||||||
|
var up = computerObject.transform.position - planetGO.transform.position;
|
||||||
|
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
||||||
|
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
||||||
|
|
||||||
|
// Move it slightly up more
|
||||||
|
computerObject.transform.position += up.normalized * 0.1f;
|
||||||
|
|
||||||
|
var computer = computerObject.GetComponent<NomaiVesselComputer>();
|
||||||
|
computer.SetSector(sector);
|
||||||
|
|
||||||
|
computer._dictNomaiTextData = MakeNomaiTextDict(xmlPath);
|
||||||
|
computer._nomaiTextAsset = new TextAsset(xmlPath);
|
||||||
|
computer._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
|
// Make sure the computer model is loaded
|
||||||
|
StreamingHandler.SetUpStreaming(computerObject, sector);
|
||||||
|
|
||||||
computerObject.SetActive(true);
|
computerObject.SetActive(true);
|
||||||
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
|
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
|
||||||
break;
|
break;
|
||||||
|
|||||||
4
NewHorizons/External/Modules/PropModule.cs
vendored
4
NewHorizons/External/Modules/PropModule.cs
vendored
@ -462,7 +462,9 @@ namespace NewHorizons.External.Modules
|
|||||||
|
|
||||||
[EnumMember(Value = @"recorder")] Recorder = 4,
|
[EnumMember(Value = @"recorder")] Recorder = 4,
|
||||||
|
|
||||||
[EnumMember(Value = @"preCrashRecorder")] PreCrashRecorder = 5
|
[EnumMember(Value = @"preCrashRecorder")] PreCrashRecorder = 5,
|
||||||
|
|
||||||
|
[EnumMember(Value = @"preCrashComputer")] PreCrashComputer = 6
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user