edited March 2022 in ORK Support
public static bool CheckCanEquip(EquipShortcut equipShortcut, Combatant combatant)
{
return equipShortcut.CanEquip(combatant);
}

How can I check this in Schematics for Select Equipment data?
No feasible node is found.
I tried to do this with the Check Function, but I cannot pass EquipShortcut as a parameter.
How can I pass EquipShortcut or List, which is a type of SelectedData, to the Function?

Comment Add -----
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GamingIsLove.Makinom.Schematics;
using GamingIsLove.Makinom;
using GamingIsLove.ORKFramework;
using GamingIsLove.Makinom.Schematics.Nodes;
using System.Linq;

[EditorHelp("Check Can Equip", "CombatantがEquipShortcutを装備可能か", "")]
// INFO: The 'NodeInfo' attribute manages in which section the node can be found in the add node selection.
[NodeInfo("CustomNode")]
public class ORKCustomNodeCheckCanEquipToCombatant : BaseSchematicCheckNode
{
[EditorTitleLabel("Combatant")]
public SchematicObjectSelection usedObject = new SchematicObjectSelection();

[EditorTitleLabel("Equipment")]
public SchematicObjectSelection usedEquipment = new SchematicObjectSelection(SchematicObjectType.SelectedData);

public override void Execute(Schematic schematic)
{
var combatant = this.usedObject.GetCombatant(schematic);

var currentEquipmentList = usedEquipment.selectedData;
if (currentEquipmentList == null) schematic.NodeFinished(this.nextFail);
var currentEquipment = currentEquipmentList.GetSelectedData(schematic).FirstOrDefault() as EquipShortcut;

if (currentEquipment.CanEquip(combatant))schematic.NodeFinished(this.next);
else schematic.NodeFinished(this.nextFail);
}
}

Now we can make the desired move for now.
Q1: Is there a standard node that allows this same check?
Q2: I would like to limit the "Equipment" EditorTitleLabel to only allow SelectedData to be entered.
 How can I do this?
public SchematicObjectSelection usedEquipment = new SchematicObjectSelection(SchematicObjectType.SelectedData);
 Even if I do this, I can still select choices other than SelectedData.
Post edited by joeee19 on
  • 1) No, I don't think there is a node for that.

    2) Use SelectedData instead:
    public SelectedData<SchematicObjectSelection> selectedData = new SelectedData<SchematicObjectSelection>();
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.