MF_B_Scanner : MF_AbstractComponent
This script will scan for enemies and store them in a Dictionary in a target list. Units should be classified into factions either using tags or layers. It’s possible to use multiple scanners all providing data to the same target list.
Inherited Variables
strength, monitor, fxScript
monitor will be 1 if any target is detected, and 0 if no targets are detected.
Public Variables
targetListScript : MF_B_TargetList
The location of MF_B_TargetList that this scanner will provide targets for. If this is blank, it will check the same game object, then recursively check parents until one is found.
match : MatchBlock
Specify the target types to detect.
targetRootObject : bool
If true, the scanner will return the root object of the detected part. Otherwise the detected object itself will be the stored target.
detectorRange : float
Maximum range the scanner can see.
detectorInterval : float
How often in seconds the scanner refreshes the target list. Lower times result in quicker updates, but use more processing power. 0 equals every frame.
lingerAdjust : float
How long after non-detection a target will remain on the target list. (Detector Interval + Linger Adjust)
requireLos : bool
Requires a clear line of sight to detect targets.
losMinRange : float
Range at which targets will not be blocked by colliders. This is useful to prevent collider geometry that is part of the scanning unit from blocking line of sight checks.
Public Class MatchBlock
scanMethod : ScanMethodType enum { Tags, Layers }
The scanner will evaluate targets by using tags or layers. Which one to use will depend on your game.
Tags: Objects are first gathered by tag, and then individually checked for range to the scanner.
Layers: Colliders are checked by range using OverlapSphere only on layers deemed targetable. If layers are used, the object on the scan layer must have a collider.
In both cases, the root GameObject of the scanned part will be stored in targetList of MF_B_TargetList.
matchBy : MatchType enum { Relation, Faction }
targetableRelation : Relation enum { Unknown, Enemy, Ally, Neutral }
If matchBy equals MatchType.Relation, will detect targets by the relations defined in MF_B_Classify.
targetableFactions : FactionType[] enum { Side0, Side1, Side2, Side3 }
If matchBy equals MatchType.Faction, lists what factions this scanner should deem as targetable. Typically, you’ll want these to be enemies of the scanning unit. Faction names must match either the tags names or the layer names.
FactionType enum definition is located in MF_enums.
This script will scan for enemies and store them in a Dictionary in a target list. Units should be classified into factions either using tags or layers. It’s possible to use multiple scanners all providing data to the same target list.
Inherited Variables
strength, monitor, fxScript
monitor will be 1 if any target is detected, and 0 if no targets are detected.
Public Variables
targetListScript : MF_B_TargetList
The location of MF_B_TargetList that this scanner will provide targets for. If this is blank, it will check the same game object, then recursively check parents until one is found.
match : MatchBlock
Specify the target types to detect.
targetRootObject : bool
If true, the scanner will return the root object of the detected part. Otherwise the detected object itself will be the stored target.
detectorRange : float
Maximum range the scanner can see.
detectorInterval : float
How often in seconds the scanner refreshes the target list. Lower times result in quicker updates, but use more processing power. 0 equals every frame.
lingerAdjust : float
How long after non-detection a target will remain on the target list. (Detector Interval + Linger Adjust)
requireLos : bool
Requires a clear line of sight to detect targets.
losMinRange : float
Range at which targets will not be blocked by colliders. This is useful to prevent collider geometry that is part of the scanning unit from blocking line of sight checks.
Public Class MatchBlock
scanMethod : ScanMethodType enum { Tags, Layers }
The scanner will evaluate targets by using tags or layers. Which one to use will depend on your game.
Tags: Objects are first gathered by tag, and then individually checked for range to the scanner.
Layers: Colliders are checked by range using OverlapSphere only on layers deemed targetable. If layers are used, the object on the scan layer must have a collider.
In both cases, the root GameObject of the scanned part will be stored in targetList of MF_B_TargetList.
matchBy : MatchType enum { Relation, Faction }
targetableRelation : Relation enum { Unknown, Enemy, Ally, Neutral }
If matchBy equals MatchType.Relation, will detect targets by the relations defined in MF_B_Classify.
targetableFactions : FactionType[] enum { Side0, Side1, Side2, Side3 }
If matchBy equals MatchType.Faction, lists what factions this scanner should deem as targetable. Typically, you’ll want these to be enemies of the scanning unit. Faction names must match either the tags names or the layer names.
FactionType enum definition is located in MF_enums.