mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Projection totems
This commit is contained in:
parent
6c1605d0e9
commit
fb537f7730
@ -10,6 +10,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace NewHorizons.Builder.Props.EchoesOfTheEye
|
||||
{
|
||||
@ -100,14 +101,27 @@ namespace NewHorizons.Builder.Props.EchoesOfTheEye
|
||||
{
|
||||
projectionObj.gameObject.AddComponent<DitheringAnimator>();
|
||||
var projection = projectionObj.gameObject.AddComponent<DreamObjectProjection>();
|
||||
projection._setActive = true;
|
||||
projection._setActive = info.toggleProjectedObjectsActive;
|
||||
projection.Awake();
|
||||
projections.Add(projection);
|
||||
}
|
||||
}
|
||||
projector._projections = projections.ToArray();
|
||||
}
|
||||
|
||||
projector.SetLit(info.startLit);
|
||||
var sensor = projector._lightSensor as SingleLightSensor;
|
||||
sensor._detectFlashlight = true;
|
||||
sensor._lightSourceMask |= LightSourceType.FLASHLIGHT;
|
||||
|
||||
projector._lit = info.startLit;
|
||||
projector._startLit = info.startLit;
|
||||
projector._extinguishOnly = info.extinguishOnly;
|
||||
/*
|
||||
Delay.FireOnNextUpdate(() =>
|
||||
{
|
||||
projector.Start();
|
||||
});
|
||||
*/
|
||||
|
||||
return totemObj;
|
||||
}
|
||||
|
||||
@ -102,6 +102,10 @@ namespace NewHorizons.Builder.Props
|
||||
// If a prop has set its parentPath and the parent cannot be found, add it to the next pass and try again later
|
||||
nextPass = new List<Action>();
|
||||
|
||||
MakeGeneralProps(go, config.Props.gravityCannons, (cannon) => GravityCannonBuilder.Make(go, sector, cannon, mod), (cannon) => cannon.shuttleID);
|
||||
MakeGeneralProps(go, config.Props.shuttles, (shuttle) => ShuttleBuilder.Make(go, sector, mod, shuttle), (shuttle) => shuttle.id);
|
||||
MakeGeneralProps(go, config.Props.details, (detail) => DetailBuilder.Make(go, sector, mod, detail), (detail) => detail.path);
|
||||
MakeGeneralProps(go, config.Props.geysers, (geyser) => GeyserBuilder.Make(go, sector, geyser));
|
||||
if (Main.HasDLC)
|
||||
{
|
||||
MakeGeneralProps(go, config.Props.dreamCandles, (candle) => DreamCandleBuilder.Make(go, sector, candle, mod));
|
||||
@ -110,12 +114,8 @@ namespace NewHorizons.Builder.Props
|
||||
MakeGeneralProps(go, config.Props.grappleTotems, (totem) => GrappleTotemBuilder.Make(go, sector, totem, mod));
|
||||
MakeGeneralProps(go, config.Props.dreamCampfires, (campfire) => DreamCampfireBuilder.Make(go, sector, campfire, mod), (campfire) => campfire.id);
|
||||
MakeGeneralProps(go, config.Props.dreamArrivalPoints, (point) => DreamArrivalPointBuilder.Make(go, sector, point, mod), (point) => point.id);
|
||||
MakeGeneralProps(go, config.Props.rafts, (raft) => RaftBuilder.Make(go, sector, raft, planetBody));
|
||||
}
|
||||
MakeGeneralProps(go, config.Props.gravityCannons, (cannon) => GravityCannonBuilder.Make(go, sector, cannon, mod), (cannon) => cannon.shuttleID);
|
||||
MakeGeneralProps(go, config.Props.shuttles, (shuttle) => ShuttleBuilder.Make(go, sector, mod, shuttle), (shuttle) => shuttle.id);
|
||||
MakeGeneralProps(go, config.Props.details, (detail) => DetailBuilder.Make(go, sector, mod, detail), (detail) => detail.path);
|
||||
MakeGeneralProps(go, config.Props.geysers, (geyser) => GeyserBuilder.Make(go, sector, geyser));
|
||||
if (Main.HasDLC) MakeGeneralProps(go, config.Props.rafts, (raft) => RaftBuilder.Make(go, sector, raft, planetBody));
|
||||
MakeGeneralProps(go, config.Props.tornados, (tornado) => TornadoBuilder.Make(go, sector, tornado, config.Atmosphere?.clouds != null));
|
||||
MakeGeneralProps(go, config.Props.volcanoes, (volcano) => VolcanoBuilder.Make(go, sector, volcano));
|
||||
MakeGeneralProps(go, config.Props.dialogue, (dialogueInfo) =>
|
||||
@ -139,6 +139,7 @@ namespace NewHorizons.Builder.Props
|
||||
MakeGeneralProps(go, config.Props.warpTransmitters, (warpTransmitter) => WarpPadBuilder.Make(go, sector, mod, warpTransmitter), (warpTransmitter) => warpTransmitter.frequency);
|
||||
MakeGeneralProps(go, config.Props.audioSources, (audioSource) => AudioSourceBuilder.Make(go, sector, audioSource, mod), (audioSource) => audioSource.audio);
|
||||
RemoteBuilder.MakeGeneralProps(go, sector, config.Props.remotes, nhBody);
|
||||
if (Main.HasDLC) MakeGeneralProps(go, config.Props.projectionTotems, (totem) => ProjectionTotemBuilder.Make(go, sector, totem, mod));
|
||||
|
||||
RunMultiPass();
|
||||
|
||||
|
||||
5
NewHorizons/External/Modules/PropModule.cs
vendored
5
NewHorizons/External/Modules/PropModule.cs
vendored
@ -153,6 +153,11 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public DreamCandleInfo[] dreamCandles;
|
||||
|
||||
/// <summary>
|
||||
/// Adds dream world projection totems (requires Echoes of the Eye DLC).
|
||||
/// </summary>
|
||||
public ProjectionTotemInfo[] projectionTotems;
|
||||
|
||||
[Obsolete("reveal is deprecated. Use Volumes->revealVolumes instead.")] public RevealVolumeInfo[] reveal;
|
||||
|
||||
[Obsolete("audioVolumes is deprecated. Use Volumes->audioVolumes instead.")] public AudioVolumeInfo[] audioVolumes;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NewHorizons.External.SerializableData;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -12,12 +13,12 @@ namespace NewHorizons.External.Modules.Props.EchoesOfTheEye
|
||||
public class AlarmTotemInfo : GeneralPropInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The maximum distance of the alarm's "vision cone".
|
||||
/// The maximum distance of the alarm's vision cone.
|
||||
/// </summary>
|
||||
[DefaultValue(45f)] public float sightDistance = 45;
|
||||
|
||||
/// <summary>
|
||||
/// The width of the alarm's "vision cone" in degrees.
|
||||
/// The width of the alarm's vision cone in degrees.
|
||||
/// </summary>
|
||||
[DefaultValue(60f)] public float sightAngle = 60f;
|
||||
|
||||
|
||||
@ -40,5 +40,10 @@ namespace NewHorizons.External.Modules.Props.EchoesOfTheEye
|
||||
/// Relative paths from this planet to objects that will appear or disappear when this totem is lit or extinguished. Some types of objects and effects are not supported and will remain visible and active.
|
||||
/// </summary>
|
||||
public string[] pathsToProjectedObjects;
|
||||
|
||||
/// <summary>
|
||||
/// If set, projected objects will be set to fully active or fully disabled instantly instead of smoothly fading lights/renderers/colliders. Use this if the normal behavior is insufficient for the objects you're using.
|
||||
/// </summary>
|
||||
public bool toggleProjectedObjectsActive;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user