mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Better name for base prop class
This commit is contained in:
parent
c8bd63e5d5
commit
88f60f883c
@ -12,7 +12,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
{
|
{
|
||||||
public static class GeneralPropBuilder
|
public static class GeneralPropBuilder
|
||||||
{
|
{
|
||||||
public static GameObject MakeFromExisting(GameObject go, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null)
|
public static GameObject MakeFromExisting(GameObject go, GameObject planetGO, Sector sector, PropModule.GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(info.rename))
|
if (!string.IsNullOrEmpty(info.rename))
|
||||||
{
|
{
|
||||||
@ -38,7 +38,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
var pos = (Vector3)(info.position ?? defaultPosition ?? Vector3.zero);
|
var pos = (Vector3)(info.position ?? defaultPosition ?? Vector3.zero);
|
||||||
var rot = Quaternion.identity;
|
var rot = Quaternion.identity;
|
||||||
if (info is PropModule.PositionedAndRotatedPropInfo rotInfo)
|
if (info is PropModule.GeneralPropInfo rotInfo)
|
||||||
{
|
{
|
||||||
rot = rotInfo.rotation != null ? Quaternion.Euler(rotInfo.rotation) : Quaternion.identity;
|
rot = rotInfo.rotation != null ? Quaternion.Euler(rotInfo.rotation) : Quaternion.identity;
|
||||||
}
|
}
|
||||||
@ -61,14 +61,14 @@ namespace NewHorizons.Builder.Props
|
|||||||
return go;
|
return go;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameObject MakeNew(string defaultName, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null)
|
public static GameObject MakeNew(string defaultName, GameObject planetGO, Sector sector, PropModule.GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null)
|
||||||
{
|
{
|
||||||
var go = new GameObject(defaultName);
|
var go = new GameObject(defaultName);
|
||||||
go.SetActive(false);
|
go.SetActive(false);
|
||||||
return MakeFromExisting(go, planetGO, sector, info, alignToBody, normal, defaultPosition, defaultParentPath);
|
return MakeFromExisting(go, planetGO, sector, info, alignToBody, normal, defaultPosition, defaultParentPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, GameObject planetGO, Sector sector, PropModule.PositionedPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null)
|
public static GameObject MakeFromPrefab(GameObject prefab, string defaultName, GameObject planetGO, Sector sector, PropModule.GeneralPointPropInfo info, bool alignToBody = false, MVector3 normal = null, MVector3 defaultPosition = null, string defaultParentPath = null)
|
||||||
{
|
{
|
||||||
var go = prefab.InstantiateInactive();
|
var go = prefab.InstantiateInactive();
|
||||||
go.name = defaultName;
|
go.name = defaultName;
|
||||||
|
|||||||
@ -78,7 +78,7 @@ namespace NewHorizons.External.Modules
|
|||||||
|
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class BrambleNodeInfo : PropModule.PositionedAndRotatedPropInfo
|
public class BrambleNodeInfo : PropModule.GeneralPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The physical scale of the node, as a multiplier of the original size.
|
/// The physical scale of the node, as a multiplier of the original size.
|
||||||
|
|||||||
34
NewHorizons/External/Modules/PropModule.cs
vendored
34
NewHorizons/External/Modules/PropModule.cs
vendored
@ -99,10 +99,10 @@ namespace NewHorizons.External.Modules
|
|||||||
[Obsolete("audioVolumes is deprecated. Use Volumes->audioVolumes instead.")] public VolumesModule.AudioVolumeInfo[] audioVolumes;
|
[Obsolete("audioVolumes is deprecated. Use Volumes->audioVolumes instead.")] public VolumesModule.AudioVolumeInfo[] audioVolumes;
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public abstract class PositionedPropInfo
|
public abstract class GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Position of the prop
|
/// Position of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MVector3 position;
|
public MVector3 position;
|
||||||
|
|
||||||
@ -123,10 +123,10 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public abstract class PositionedAndRotatedPropInfo : PositionedPropInfo
|
public abstract class GeneralPropInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Rotation of the prop
|
/// Rotation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MVector3 rotation;
|
public MVector3 rotation;
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class DetailInfo : PositionedAndRotatedPropInfo
|
public class DetailInfo : GeneralPropInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -265,7 +265,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class RaftInfo : PositionedPropInfo
|
public class RaftInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Acceleration of the raft. Default acceleration is 5.
|
/// Acceleration of the raft. Default acceleration is 5.
|
||||||
@ -274,7 +274,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class GeyserInfo : PositionedPropInfo
|
public class GeyserInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vertical offset of the geyser. From 0, the bubbles start at a height of 10, the shaft at 67, and the spout at 97.5.
|
/// Vertical offset of the geyser. From 0, the bubbles start at a height of 10, the shaft at 67, and the spout at 97.5.
|
||||||
@ -313,7 +313,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class TornadoInfo : PositionedPropInfo
|
public class TornadoInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public enum TornadoType
|
public enum TornadoType
|
||||||
@ -375,7 +375,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class VolcanoInfo : PositionedPropInfo
|
public class VolcanoInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The colour of the meteor's lava.
|
/// The colour of the meteor's lava.
|
||||||
@ -418,7 +418,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class DialogueInfo : PositionedPropInfo
|
public class DialogueInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue
|
/// Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue
|
||||||
@ -486,7 +486,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class EntryLocationInfo : PositionedPropInfo
|
public class EntryLocationInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this location is cloaked
|
/// Whether this location is cloaked
|
||||||
@ -500,7 +500,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class NomaiTextInfo : PositionedPropInfo
|
public class NomaiTextInfo : GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public enum NomaiTextType
|
public enum NomaiTextType
|
||||||
@ -616,7 +616,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class ProjectionInfo : PositionedAndRotatedPropInfo
|
public class ProjectionInfo : GeneralPropInfo
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public enum SlideShowType
|
public enum SlideShowType
|
||||||
@ -783,7 +783,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class QuantumSocketInfo : PositionedAndRotatedPropInfo
|
public class QuantumSocketInfo : GeneralPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the socket will be placed relative to the group it belongs to. Overrides `isRelativeToParent`
|
/// Whether the socket will be placed relative to the group it belongs to. Overrides `isRelativeToParent`
|
||||||
@ -824,7 +824,7 @@ namespace NewHorizons.External.Modules
|
|||||||
public StoneInfo[] stones;
|
public StoneInfo[] stones;
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class WhiteboardInfo : PositionedAndRotatedPropInfo
|
public class WhiteboardInfo : GeneralPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The text for each stone
|
/// The text for each stone
|
||||||
@ -872,7 +872,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class PlatformInfo : PositionedAndRotatedPropInfo
|
public class PlatformInfo : GeneralPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A ship log fact to reveal when the platform is connected to.
|
/// A ship log fact to reveal when the platform is connected to.
|
||||||
@ -891,7 +891,7 @@ namespace NewHorizons.External.Modules
|
|||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class StoneInfo : PositionedAndRotatedPropInfo
|
public class StoneInfo : GeneralPropInfo
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
NewHorizons/External/Modules/SignalModule.cs
vendored
2
NewHorizons/External/Modules/SignalModule.cs
vendored
@ -15,7 +15,7 @@ namespace NewHorizons.External.Modules
|
|||||||
public SignalInfo[] signals;
|
public SignalInfo[] signals;
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class SignalInfo : PropModule.PositionedPropInfo
|
public class SignalInfo : PropModule.GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
[Obsolete("audioClip is deprecated, please use audio instead")]
|
[Obsolete("audioClip is deprecated, please use audio instead")]
|
||||||
public string audioClip;
|
public string audioClip;
|
||||||
|
|||||||
@ -9,7 +9,7 @@ using Newtonsoft.Json.Converters;
|
|||||||
namespace NewHorizons.External.Modules.VariableSize
|
namespace NewHorizons.External.Modules.VariableSize
|
||||||
{
|
{
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class SingularityModule : PropModule.PositionedAndRotatedPropInfo
|
public class SingularityModule : PropModule.GeneralPropInfo
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public enum SingularityType
|
public enum SingularityType
|
||||||
|
|||||||
@ -117,7 +117,7 @@ namespace NewHorizons.External.Modules
|
|||||||
public LoadCreditsVolumeInfo[] creditsVolume;
|
public LoadCreditsVolumeInfo[] creditsVolume;
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class VolumeInfo : PropModule.PositionedPropInfo
|
public class VolumeInfo : PropModule.GeneralPointPropInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The radius of this volume.
|
/// The radius of this volume.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user