mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
you gotta give a sector to SetUpStreaming
This commit is contained in:
parent
6629d2292d
commit
8207472983
@ -187,8 +187,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
var path = config.isSeed ? brambleSeedPrefabPath : brambleNodePrefabPath;
|
var path = config.isSeed ? brambleSeedPrefabPath : brambleNodePrefabPath;
|
||||||
var brambleNode = SearchUtilities.Find(path).InstantiateInactive();
|
var brambleNode = SearchUtilities.Find(path).InstantiateInactive();
|
||||||
|
|
||||||
StreamingHandler.SetUpStreaming(brambleNode);
|
StreamingHandler.SetUpStreaming(brambleNode, sector);
|
||||||
sector.OnOccupantEnterSector += (sd) => StreamingHandler.OnOccupantEnterSector(brambleNode, sd, sector);
|
|
||||||
|
|
||||||
brambleNode.transform.parent = sector.transform;
|
brambleNode.transform.parent = sector.transform;
|
||||||
brambleNode.transform.position = go.transform.TransformPoint(config.position);
|
brambleNode.transform.position = go.transform.TransformPoint(config.position);
|
||||||
|
|||||||
@ -109,8 +109,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
prop.transform.parent = sector?.transform ?? planetGO.transform;
|
prop.transform.parent = sector?.transform ?? planetGO.transform;
|
||||||
prop.SetActive(false);
|
prop.SetActive(false);
|
||||||
|
|
||||||
if (sector != null) sector.OnOccupantEnterSector += (SectorDetector sd) => StreamingHandler.OnOccupantEnterSector(prop, sd, sector);
|
StreamingHandler.SetUpStreaming(prop, sector);
|
||||||
StreamingHandler.SetUpStreaming(prop);
|
|
||||||
|
|
||||||
foreach (var component in prop.GetComponents<Component>().Concat(prop.GetComponentsInChildren<Component>()))
|
foreach (var component in prop.GetComponents<Component>().Concat(prop.GetComponentsInChildren<Component>()))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -201,8 +201,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
// Make sure the computer model is loaded
|
// Make sure the computer model is loaded
|
||||||
StreamingHandler.SetUpStreaming(computerObject);
|
StreamingHandler.SetUpStreaming(computerObject, sector);
|
||||||
sector.OnOccupantEnterSector.AddListener((x) => StreamingHandler.SetUpStreaming(computerObject));
|
|
||||||
|
|
||||||
computerObject.SetActive(true);
|
computerObject.SetActive(true);
|
||||||
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
|
conversationInfoToCorrespondingSpawnedGameObject[info] = computerObject;
|
||||||
@ -249,8 +248,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
// Make sure the computer model is loaded
|
// Make sure the computer model is loaded
|
||||||
StreamingHandler.SetUpStreaming(cairnObject);
|
StreamingHandler.SetUpStreaming(cairnObject, sector);
|
||||||
sector.OnOccupantEnterSector.AddListener((x) => StreamingHandler.SetUpStreaming(cairnObject));
|
|
||||||
conversationInfoToCorrespondingSpawnedGameObject[info] = cairnObject;
|
conversationInfoToCorrespondingSpawnedGameObject[info] = cairnObject;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -281,8 +279,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
// Make sure the recorder model is loaded
|
// Make sure the recorder model is loaded
|
||||||
StreamingHandler.SetUpStreaming(recorderObject);
|
StreamingHandler.SetUpStreaming(recorderObject, sector);
|
||||||
sector.OnOccupantEnterSector.AddListener((x) => StreamingHandler.SetUpStreaming(recorderObject));
|
|
||||||
|
|
||||||
recorderObject.SetActive(true);
|
recorderObject.SetActive(true);
|
||||||
|
|
||||||
|
|||||||
@ -129,8 +129,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
// Idk why but it wants reveals to be comma delimited not a list
|
// Idk why but it wants reveals to be comma delimited not a list
|
||||||
if (info.reveals != null) slideCollectionContainer._shipLogOnComplete = string.Join(",", info.reveals);
|
if (info.reveals != null) slideCollectionContainer._shipLogOnComplete = string.Join(",", info.reveals);
|
||||||
|
|
||||||
StreamingHandler.SetUpStreaming(slideReelObj);
|
StreamingHandler.SetUpStreaming(slideReelObj, sector);
|
||||||
sector.OnOccupantEnterSector.AddListener((x) => StreamingHandler.SetUpStreaming(slideReelObj));
|
|
||||||
|
|
||||||
slideReelObj.SetActive(true);
|
slideReelObj.SetActive(true);
|
||||||
}
|
}
|
||||||
@ -180,8 +179,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
slideCollectionContainer.slideCollection = slideCollection;
|
slideCollectionContainer.slideCollection = slideCollection;
|
||||||
|
|
||||||
StreamingHandler.SetUpStreaming(projectorObj);
|
StreamingHandler.SetUpStreaming(projectorObj, sector);
|
||||||
sector.OnOccupantEnterSector.AddListener((x) => StreamingHandler.SetUpStreaming(projectorObj));
|
|
||||||
|
|
||||||
// Change the picture on the lens
|
// Change the picture on the lens
|
||||||
var lens = projectorObj.transform.Find("Spotlight/Prop_IP_SingleSlideProjector/Projector_Lens").GetComponent<MeshRenderer>();
|
var lens = projectorObj.transform.Find("Spotlight/Prop_IP_SingleSlideProjector/Projector_Lens").GetComponent<MeshRenderer>();
|
||||||
|
|||||||
@ -29,8 +29,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
raftObject.transform.position = planetGO.transform.TransformPoint(info.position);
|
raftObject.transform.position = planetGO.transform.TransformPoint(info.position);
|
||||||
raftObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.identity);
|
raftObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.identity);
|
||||||
|
|
||||||
sector.OnOccupantEnterSector += (sd) => StreamingHandler.OnOccupantEnterSector(raftObject, sd, sector);
|
StreamingHandler.SetUpStreaming(raftObject, sector);
|
||||||
StreamingHandler.SetUpStreaming(raftObject);
|
|
||||||
|
|
||||||
var raftController = raftObject.GetComponent<RaftController>();
|
var raftController = raftObject.GetComponent<RaftController>();
|
||||||
// Since awake already ran we have to unhook these events
|
// Since awake already ran we have to unhook these events
|
||||||
|
|||||||
@ -136,8 +136,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
controller._midBone.localPosition = controller._midStartPos;
|
controller._midBone.localPosition = controller._midStartPos;
|
||||||
controller._topBone.localPosition = controller._topStartPos;
|
controller._topBone.localPosition = controller._topStartPos;
|
||||||
|
|
||||||
StreamingHandler.SetUpStreaming(tornadoGO);
|
StreamingHandler.SetUpStreaming(tornadoGO, sector);
|
||||||
sector.OnOccupantEnterSector += (sd) => StreamingHandler.SetUpStreaming(tornadoGO);
|
|
||||||
|
|
||||||
tornadoGO.GetComponentInChildren<CapsuleShape>().enabled = true;
|
tornadoGO.GetComponentInChildren<CapsuleShape>().enabled = true;
|
||||||
|
|
||||||
|
|||||||
@ -17,23 +17,10 @@ namespace NewHorizons.Handlers
|
|||||||
_objectCache = new Dictionary<GameObject, List<string>>();
|
_objectCache = new Dictionary<GameObject, List<string>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OnOccupantEnterSector(GameObject obj, SectorDetector sd, Sector sector)
|
|
||||||
{
|
|
||||||
SetUpStreaming(obj);
|
|
||||||
|
|
||||||
// If its too laggy put this back idk
|
|
||||||
/*
|
|
||||||
if (sector.GetOccupants().Count > 0 || sd._occupantType == DynamicOccupant.Player)
|
|
||||||
{
|
|
||||||
LoadObject(obj);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// makes it so that this object's streaming stuff will be connected to the given sector
|
/// makes it so that this object's streaming stuff will be connected to the given sector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetUpStreaming(GameObject obj, Sector sector = null)
|
public static void SetUpStreaming(GameObject obj, Sector sector)
|
||||||
{
|
{
|
||||||
List<string> assetBundles;
|
List<string> assetBundles;
|
||||||
if (_objectCache.ContainsKey(obj))
|
if (_objectCache.ContainsKey(obj))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user