Class InteractionAttribute
Block of data sent to the client that defines how a general interactor works. Method applied to must have signature: void X(Player player, InteractionTriggerInfo trigger, InteractionTarget target, List{Tag} tagsTargetable)
Inheritance
System.Object
InteractionAttribute
Assembly: Eco.Gameplay.dll
Syntax
public class InteractionAttribute : RPCAttribute, IController, IViewController, IHasUniversalID
Constructors
InteractionAttribute(InteractionTrigger, String, InteractionModifier, String[], Single, Single, ClientPredictedBlockAction, Int32, Boolean, TriBool, String, AccessType, Boolean, InteractionFlags, String, String[])
Declaration
public InteractionAttribute(InteractionTrigger trigger, string overrideDescription = null, InteractionModifier modifier, string[] requiredEnvVars = null, float interactionDistance = 0F, float priority = 0F, ClientPredictedBlockAction predictedBlockAction, int maxTake = 0, bool animationDriven = false, TriBool canHoldToTrigger, string highlightColorHex = null, AccessType authRequired, bool enforceAuth = false, InteractionFlags flags, string uiType = null, params string[] tags)
Parameters
Properties
AccessForHighlight
Declaration
public AccessType AccessForHighlight { get; set; }
Property Value
AnimationDriven
Declaration
public bool AnimationDriven { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AreaBlocks
Declaration
public Vector2i[] AreaBlocks { get; set; }
Property Value
CanHoldToTrigger
Declaration
public TriBool CanHoldToTrigger { get; set; }
Property Value
ControllerID
Declaration
public ref int ControllerID { get; }
Property Value
Type |
Description |
System.Int32 |
|
Description
Description of the interaction, taken from the name of the method it's applied on, but can be overriden via our constructor.
Declaration
public LocString Description { get; set; }
Property Value
DisallowedEnvVars
Environment vars that, if present and assigned any value besides 'false', will block the interaction.
Declaration
public string[] DisallowedEnvVars { get; set; }
Property Value
Type |
Description |
System.String[] |
|
Flags
Declaration
public InteractionFlags Flags { get; set; }
Property Value
HighlightColor
Declaration
public Color HighlightColor { get; set; }
Property Value
InteractionDistance
Max distance allowed to interact, 0 means default distance.
Declaration
public float InteractionDistance { get; set; }
Property Value
Type |
Description |
System.Single |
|
InteractorType
Declaration
public Type InteractorType { get; set; }
Property Value
Type |
Description |
System.Type |
|
MaxTake
Declaration
public int MaxTake { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
MinCaloriesRequired
Min calories required to perform the action. The ingteraction may still consume more than this. And the consumption doesnt happen automatically, the interaction func must do it.
Declaration
public float MinCaloriesRequired { get; set; }
Property Value
Type |
Description |
System.Single |
|
PredictedBlockAction
Define an action that can happen instantly on the client when the interaction takes place, and can be rewound if the server doesnt accept it.
Declaration
public ClientPredictedBlockAction PredictedBlockAction { get; set; }
Property Value
Priority
When two interactions are set on the same trigger, priority determines which is displayed and available.
Declaration
public float Priority { get; set; }
Property Value
Type |
Description |
System.Single |
|
RequiredEnvVars
Parameters that would allow this interaction to trigger (if a tag also matches). Exists to allow state-based definitions for WorldObjects (--e.g.: 'Turn on' vs 'Turn off', etc)
Declaration
public string[] RequiredEnvVars { get; set; }
Property Value
Type |
Description |
System.String[] |
|
RPCName
Name of the RPC to call. This is called on the interactor, but if the interactor is null its called on the target.
Declaration
public string RPCName { get; set; }
Property Value
Type |
Description |
System.String |
|
SubComponentTypeRPCTarget
If set, means that the RPC is called on the given subcomponent of a world object.
Declaration
public Type SubComponentTypeRPCTarget { get; set; }
Property Value
Type |
Description |
System.Type |
|
Blocks, NetObjects, and Items that have ANY of these tags can trigger this interaction.
Declaration
public Tag[] TagsTargetable { get; set; }
Property Value
TriggerInfo
Declaration
public InteractionTriggerInfo TriggerInfo { get; set; }
Property Value
UIType
If we're includiung any views as envar paremeters in the description, they can be created on the client as prefabs of this type (listed in UIPrefab)
Declaration
public string UIType { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
Init(Type, String)
Init an interaction definition defined on an interactor.
Declaration
public void Init(Type interactorType, string rpcName)
Parameters
Type |
Name |
Description |
System.Type |
interactorType |
|
System.String |
rpcName |
|
Implements
Extension Methods