mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' of https://github.com/Outer-Wilds-New-Horizons/new-horizons into dev
This commit is contained in:
commit
641b1d7b97
@ -51,6 +51,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
item.DisplayName = itemName;
|
item.DisplayName = itemName;
|
||||||
item.ItemType = itemType;
|
item.ItemType = itemType;
|
||||||
item.Droppable = info.droppable;
|
item.Droppable = info.droppable;
|
||||||
|
item.HoldOffset = info.holdOffset ?? Vector3.zero;
|
||||||
|
item.HoldRotation = info.holdRotation ?? Vector3.zero;
|
||||||
|
item.SocketOffset = info.socketOffset ?? Vector3.zero;
|
||||||
|
item.SocketRotation = info.socketRotation ?? Vector3.zero;
|
||||||
if (!string.IsNullOrEmpty(info.pickupAudio))
|
if (!string.IsNullOrEmpty(info.pickupAudio))
|
||||||
{
|
{
|
||||||
item.PickupAudio = AudioTypeHandler.GetAudioType(info.pickupAudio, mod);
|
item.PickupAudio = AudioTypeHandler.GetAudioType(info.pickupAudio, mod);
|
||||||
|
|||||||
@ -19,6 +19,10 @@ namespace NewHorizons.Components.Props
|
|||||||
public AudioType DropAudio;
|
public AudioType DropAudio;
|
||||||
public AudioType SocketAudio;
|
public AudioType SocketAudio;
|
||||||
public AudioType UnsocketAudio;
|
public AudioType UnsocketAudio;
|
||||||
|
public Vector3 HoldOffset;
|
||||||
|
public Vector3 HoldRotation;
|
||||||
|
public Vector3 SocketOffset;
|
||||||
|
public Vector3 SocketRotation;
|
||||||
public string PickupCondition;
|
public string PickupCondition;
|
||||||
public bool ClearPickupConditionOnDrop;
|
public bool ClearPickupConditionOnDrop;
|
||||||
public string PickupFact;
|
public string PickupFact;
|
||||||
@ -42,6 +46,8 @@ namespace NewHorizons.Components.Props
|
|||||||
public override void PickUpItem(Transform holdTranform)
|
public override void PickUpItem(Transform holdTranform)
|
||||||
{
|
{
|
||||||
base.PickUpItem(holdTranform);
|
base.PickUpItem(holdTranform);
|
||||||
|
transform.localPosition = HoldOffset;
|
||||||
|
transform.localEulerAngles = HoldRotation;
|
||||||
TriggerPickupConditions();
|
TriggerPickupConditions();
|
||||||
PlayCustomSound(PickupAudio);
|
PlayCustomSound(PickupAudio);
|
||||||
}
|
}
|
||||||
@ -56,6 +62,8 @@ namespace NewHorizons.Components.Props
|
|||||||
public override void SocketItem(Transform socketTransform, Sector sector)
|
public override void SocketItem(Transform socketTransform, Sector sector)
|
||||||
{
|
{
|
||||||
base.SocketItem(socketTransform, sector);
|
base.SocketItem(socketTransform, sector);
|
||||||
|
transform.localPosition = SocketOffset;
|
||||||
|
transform.localEulerAngles = SocketRotation;
|
||||||
TriggerDropConditions();
|
TriggerDropConditions();
|
||||||
PlayCustomSound(SocketAudio);
|
PlayCustomSound(SocketAudio);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,22 @@ namespace NewHorizons.External.Modules.Props.Item
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MVector3 dropNormal;
|
public MVector3 dropNormal;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// A relative offset to apply to the item's position when holding it. The initial position varies for vanilla item types.
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 holdOffset;
|
||||||
|
/// <summary>
|
||||||
|
/// A relative offset to apply to the item's rotation when holding it.
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 holdRotation;
|
||||||
|
/// <summary>
|
||||||
|
/// A relative offset to apply to the item's position when placing it into a socket.
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 socketOffset;
|
||||||
|
/// <summary>
|
||||||
|
/// A relative offset to apply to the item's rotation when placing it into a socket.
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 socketRotation;
|
||||||
|
/// <summary>
|
||||||
/// The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.
|
/// The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.
|
||||||
/// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
/// Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1429,6 +1429,22 @@
|
|||||||
"description": "The direction the item will be oriented when dropping it on the ground. Defaults to up (0, 1, 0).",
|
"description": "The direction the item will be oriented when dropping it on the ground. Defaults to up (0, 1, 0).",
|
||||||
"$ref": "#/definitions/MVector3"
|
"$ref": "#/definitions/MVector3"
|
||||||
},
|
},
|
||||||
|
"holdOffset": {
|
||||||
|
"description": "A relative offset to apply to the item's position when holding it. The initial position varies for vanilla item types.",
|
||||||
|
"$ref": "#/definitions/MVector3"
|
||||||
|
},
|
||||||
|
"holdRotation": {
|
||||||
|
"description": "A relative offset to apply to the item's rotation when holding it.",
|
||||||
|
"$ref": "#/definitions/MVector3"
|
||||||
|
},
|
||||||
|
"socketOffset": {
|
||||||
|
"description": "A relative offset to apply to the item's position when placing it into a socket.",
|
||||||
|
"$ref": "#/definitions/MVector3"
|
||||||
|
},
|
||||||
|
"socketRotation": {
|
||||||
|
"description": "A relative offset to apply to the item's rotation when placing it into a socket.",
|
||||||
|
"$ref": "#/definitions/MVector3"
|
||||||
|
},
|
||||||
"pickupAudio": {
|
"pickupAudio": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list."
|
"description": "The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user