MF_EasyScan_UnitList
This is a master list of all units that can be interacted with from MF_EasyScan for classification, detection, and targeting.
One must be placed in your scene. Upon placement it will auto generate a list of factions (as defined by enum FactionType) and what other factions constitute as enemies, neutral, or allies. Changing the size of FactionType or the list will trigger a re-calibration.
Units entering the scene (or becoming enabled) should add themselves to this list, and remove themselves when becoming disabled. Additionally, the list will periodically look for null entries and remove them according to the cleanInterval.
Public Methods
AddUnit : void ( target : MF_EasyScan )
Use to add a unit to the list.
CleanList : void ()
Immediately clean the unit list.
GetRelation : RelationType ( myFaction : FactionType, testFaction : FactionType )
Returns the relation between to factions, from the point of view of myFaction.
IsVisibleToFaction : bool ( unit : MF_EasyScan, faction : FactionType )
IsVisibleToFaction : bool ( index int, faction FactionType )
Finds if unit or unit at index of unitList is visible (is currently scanned) by faction.
NewCleanInterval : void ( interval : float )
May be used to change the time interval to clean the list of null entries. A value of 0 will suspend list cleaning.
RemoveUnit : void ( target : MF_EasyScan )
Use to remove a unit from the list.
Public Variables
factionRelations : List<RelationBlock>
Target that can be initially set in the editor. Changing this during runtime has no effect.
unitList : List<MF_EasyScan>
Contains a list of all units using MF_EasyScan.
Private Variables
cleanInterval : float
Exposed in the inspector to allow user to change this.
How often unitList will check for null entries and remove them. A value of 0 will suspend list cleaning.
Public Class RelationBlock
enemies : enum FactionType { Editor, Side1, Side2 }
Factions listed here are considered enemies of the parent class faction.
neutral : enum FactionType { Editor, Side1, Side2 }
Factions listed here are considered neutral to the parent class faction.
allies : enum FactionType { Editor, Side1, Side2 }
Factions listed here are considered allies of the parent class faction. Note that same faction units are automatically considered allied.
This is a master list of all units that can be interacted with from MF_EasyScan for classification, detection, and targeting.
One must be placed in your scene. Upon placement it will auto generate a list of factions (as defined by enum FactionType) and what other factions constitute as enemies, neutral, or allies. Changing the size of FactionType or the list will trigger a re-calibration.
Units entering the scene (or becoming enabled) should add themselves to this list, and remove themselves when becoming disabled. Additionally, the list will periodically look for null entries and remove them according to the cleanInterval.
Public Methods
AddUnit : void ( target : MF_EasyScan )
Use to add a unit to the list.
CleanList : void ()
Immediately clean the unit list.
GetRelation : RelationType ( myFaction : FactionType, testFaction : FactionType )
Returns the relation between to factions, from the point of view of myFaction.
IsVisibleToFaction : bool ( unit : MF_EasyScan, faction : FactionType )
IsVisibleToFaction : bool ( index int, faction FactionType )
Finds if unit or unit at index of unitList is visible (is currently scanned) by faction.
NewCleanInterval : void ( interval : float )
May be used to change the time interval to clean the list of null entries. A value of 0 will suspend list cleaning.
RemoveUnit : void ( target : MF_EasyScan )
Use to remove a unit from the list.
Public Variables
factionRelations : List<RelationBlock>
Target that can be initially set in the editor. Changing this during runtime has no effect.
unitList : List<MF_EasyScan>
Contains a list of all units using MF_EasyScan.
Private Variables
cleanInterval : float
Exposed in the inspector to allow user to change this.
How often unitList will check for null entries and remove them. A value of 0 will suspend list cleaning.
Public Class RelationBlock
enemies : enum FactionType { Editor, Side1, Side2 }
Factions listed here are considered enemies of the parent class faction.
neutral : enum FactionType { Editor, Side1, Side2 }
Factions listed here are considered neutral to the parent class faction.
allies : enum FactionType { Editor, Side1, Side2 }
Factions listed here are considered allies of the parent class faction. Note that same faction units are automatically considered allied.