Update scene document validation for NPC entities
This commit is contained in:
@@ -3348,13 +3348,14 @@ function validateInteractionLink(
|
||||
|
||||
if (
|
||||
sourceEntity.kind !== "triggerVolume" &&
|
||||
sourceEntity.kind !== "interactable"
|
||||
sourceEntity.kind !== "interactable" &&
|
||||
sourceEntity.kind !== "npc"
|
||||
) {
|
||||
diagnostics.push(
|
||||
createDiagnostic(
|
||||
"error",
|
||||
"invalid-interaction-source-kind",
|
||||
"Interaction links may only source from Trigger Volume or Interactable entities in the current slice.",
|
||||
"Interaction links may only source from Trigger Volume, Interactable, or NPC entities in the current slice.",
|
||||
`${path}.sourceEntityId`
|
||||
)
|
||||
);
|
||||
@@ -3382,6 +3383,17 @@ function validateInteractionLink(
|
||||
)
|
||||
);
|
||||
}
|
||||
} else if (sourceEntity.kind === "npc") {
|
||||
if (link.trigger !== "click") {
|
||||
diagnostics.push(
|
||||
createDiagnostic(
|
||||
"error",
|
||||
"unsupported-interaction-trigger",
|
||||
"NPC links may only use the click trigger.",
|
||||
`${path}.trigger`
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
switch (link.action.type) {
|
||||
|
||||
Reference in New Issue
Block a user