Targeting System 3
Public Member Functions | Properties | List of all members
Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem Class Reference

Class that shows up as a targeting system controller for the user. Main class for using the targeting system plugin. More...

Inheritance diagram for Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem:

Public Member Functions

int CompareTo (GV_TargetingSystem other)
 Compares targeting systems group index to this system group index.
 
Target GetClosestTarget (bool forceUpdate)
 Gets closest entity or gameObject as target according to parameters set by the user from GV_TargetingSystem component.
 
Target GetClosestTargetFromSlot (int slot, bool forceUpdate, bool alsoShowIndicatorFromThisSlot)
 Gets closest entity or gameObject as target according to parameters set by the user from GV_TargetingSystem component.
 
GameObject GetClosestTargetFromSlotAsGameObject (int slot, bool forceUpdate)
 Gets closest gameObject, if none return null.
 
GameObject GetClosestTargetAsGameObject (bool forceUpdate)
 Gets closest gameObject.
 
NativeSlice< Target > GetClosestTargets (bool forceUpdate)
 Gets targets for both entities and GameObject. Then sorts them.
 
NativeSlice< Target > GetClosestTargets (bool forceUpdate, bool coldStart)
 Gets targets for both entities and GameObject. Then sorts them in case force update is used. Otherwise just returns the target list.
 
IEnumerator DestroyTargetAfter (Target target, float time)
 Function coroutine that can be used to destroy game object or entity target.
 
void DestroyGameObjectTargetAtDistanceToObject (Target target, Transform transform, float distanceToDestroyAt, float timeOut)
 Function that starts coroutine that can be used to destroy game object target after reaching given distance from targeting system.
 
void TriggerTargetingActions (Target target)
 Spawn prefabs from actions template object.
 
TargetingSystemDataModels.GeometryInfo GetGeoInfoBasedOnHashCode (int4 geoInfoHashCode)
 Gets you a GeoInfo of a target object based on the given hashcode. Does not care about if its seen or not.
 
TargetingSystemDataModels.GeometryInfo GetSeenGeoInfoBasedOnHashCode (int4 geoInfoHashCode)
 Gets you a visible GeoInfo of a target object based on the given hashcode.
 
Target GetTargetBasedOnHashCode (int4 geoInfoHashCode)
 Gets you a GeoInfo of a target object based on the hashCode inside it.
 
GetVisibilityProcessor< T > ()
 Used to get the eye implementation for either game object or entities from hash set.
 
void ChangeTargetingIndicatorsSlot (int slotToUse)
 Which target to show from the queue. Requires target indicating to be turned on.
 
void SetGameObjectBasedProcessingOnOrOff (bool onOff)
 
void ChangeTargetingInstructionTag (string newTagForTheInstruction, int targetingInstructionIndex)
 
void AddTargetingInstruction (TargetingInstruction targetingInstruction)
 
void RemoveTargetingInstruction (TargetingInstruction targetingInstruction)
 
void ChangeTargetingInstructionTag (GeometryType geometryType, string newTag, string oldTag)
 
void OnBeforeSerialize ()
 
void OnAfterDeserialize ()
 
void ForceSetTargetingSystemIndex (int4 newTargetingSystemIndex)
 
Vector3 DirectionInWorldSpace ()
 Calculates forward vector from systems position and its forward vector.
 
int GetCullingModeAsInt ()
 

Properties

int AdditionalTargetsCount [get, set]
 
int4 TargetingSystemIndex [get, set]
 
bool EntityBasedProcessing [get]
 
TargetingSystemMemory SystemsMemory [get, set]
 
Target ClosestTarget [get, set]
 
int TargetingIndicatorSlotToUse [get]
 
bool ClosestEdgeFetchedForCurrentFrame [get, set]
 
EdgeDataModels.Edge ClosestEdgeTarget [get, set]
 
Transform TargetingIndicatorObject [get, set]
 Targeting locator or indicator GameObject made to visualise the closest target, if wanted.
 
TargetingSystemDataModels.CullingBehaviour CullingBehaviour [get, set]
 
float FieldOfView [get, set]
 
List< TargetingInstruction > TargetingInstructionsWithRefresh [get]
 Has refresh functionality added to the getter. Use this for adding new instruction in non performance critical scenarios. It re updates cache and fixes missing target processors if any.
 
List< TargetingInstruction > TargetingInstructions [get]
 
TargetVisibilityDebugger VisibilityDebugger [get, set]
 
bool GameObjectProcessing [get, set]
 
SortedList< ITargetVisibilityProcessor, ITargetVisibilityProcessor > TargetVisibilityProcessors [get, set]
 
TargetingSystemsRunner TargetingSystemsRunner [get, set]
 Link to targetingSystemsRunner that is shared across all targeting systems.
 
NativeList< Target > ClosestTargetsContainer [get, set]
 For direct access use memory as below. This returns temporary copy of the memory.
 
int NumberOfTargets [get, set]
 
int PreviousNumberOfTargets [get, set]
 
int NumberOfLockedTargets [get, set]
 
int PreviousNumberOfLockedTargets [get, set]
 
float IndicatorVisibilityDistance [get, set]
 
int TargetingSystemGroupIndex [get, set]
 
bool BlockTargetsOutsideIndicatorVisibilityDistance [get, set]
 
bool TargetIndicatingEnabled [get, set]
 
uint NumberOfIndicatorsToShow [get, set]
 
float TargetSettingsBlendWeight [get, set]
 
float TargetingDistance [get, set]
 

Detailed Description

Class that shows up as a targeting system controller for the user. Main class for using the targeting system plugin.

Usage: Add to objects you want to act as a targeting system. The component will handle the rest. A lot of the settings are meant to be adjusted from the inspector UI. Do not add this to camera object since it creates its own camera and hides it from the user. Create empty gameobject instead and add that as a child object to the camera.

Member Function Documentation

◆ AddTargetingInstruction()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.AddTargetingInstruction ( TargetingInstruction targetingInstruction)

◆ ChangeTargetingIndicatorsSlot()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ChangeTargetingIndicatorsSlot ( int slotToUse)

Which target to show from the queue. Requires target indicating to be turned on.

Parameters
slotToUseClosest target indicator slot/index. For example slot 1 would the second closest target.

◆ ChangeTargetingInstructionTag() [1/2]

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ChangeTargetingInstructionTag ( GeometryType geometryType,
string newTag,
string oldTag )

◆ ChangeTargetingInstructionTag() [2/2]

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ChangeTargetingInstructionTag ( string newTagForTheInstruction,
int targetingInstructionIndex )

◆ CompareTo()

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.CompareTo ( GV_TargetingSystem other)

Compares targeting systems group index to this system group index.

Parameters
otherSystem to compare to.
Returns
0 if equal otherwise value indicating less or greater.

◆ DestroyGameObjectTargetAtDistanceToObject()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.DestroyGameObjectTargetAtDistanceToObject ( Target target,
Transform transform,
float distanceToDestroyAt,
float timeOut )

Function that starts coroutine that can be used to destroy game object target after reaching given distance from targeting system.

Parameters
targetTarget to destroy
distanceToDestroyAtDistance from target to targetProcessorSystem component, if closer then the target gets destroyed
timeOutAfter time out the target gets destroyed no matter what happens.

◆ DestroyTargetAfter()

IEnumerator Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.DestroyTargetAfter ( Target target,
float time )

Function coroutine that can be used to destroy game object or entity target.

Parameters
targetTarget wanted to be destroyed
timeTime after target is destroyed

◆ DirectionInWorldSpace()

Vector3 Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.DirectionInWorldSpace ( )

Calculates forward vector from systems position and its forward vector.

Returns
Directional vector pointing forward from systems world space coordinates.

◆ ForceSetTargetingSystemIndex()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ForceSetTargetingSystemIndex ( int4 newTargetingSystemIndex)

◆ GetClosestTarget()

Target Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetClosestTarget ( bool forceUpdate)

Gets closest entity or gameObject as target according to parameters set by the user from GV_TargetingSystem component.

Normally update is done every frame so calling this with forceUpdate set to true will impact performance when using multiple systems. Use case where this might be needed, is when something is destroyed on the main thread and the new target search is required immediately for next function or when measuring performance.

Parameters
forceUpdateSchedules a job to instantly update targets.
Returns
Closest Target that contain information about gameObject or entity. If there is none return empty target that by default does not exist.

◆ GetClosestTargetAsGameObject()

GameObject Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetClosestTargetAsGameObject ( bool forceUpdate)

Gets closest gameObject.

Parameters
forceUpdateSchedules a job to instantly update targets.
Returns
gameObject, if none return null

◆ GetClosestTargetFromSlot()

Target Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetClosestTargetFromSlot ( int slot,
bool forceUpdate,
bool alsoShowIndicatorFromThisSlot )

Gets closest entity or gameObject as target according to parameters set by the user from GV_TargetingSystem component.

Normally update is done every frame so calling this with forceUpdate set to true will impact performance when using multiple systems. Use case where this might be needed, is when something is destroyed on the main thread and the new target search is required immediately for next function or when measuring performance changes.

Parameters
slotIndex can be specified. Getting a target from slot 2 would mean getting the second closest target.
forceUpdateSchedules a job to instantly update targets.
alsoShowIndicatorFromThisSlotChanges the slot of the target indicator. For example 1 would be the second most closest.
Returns
Closest Target from slot/index that contain information about gameObject or entity.

◆ GetClosestTargetFromSlotAsGameObject()

GameObject Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetClosestTargetFromSlotAsGameObject ( int slot,
bool forceUpdate )

Gets closest gameObject, if none return null.

Parameters
slotIndex can be specified. Getting a target from slot 2 would mean getting the second closest target.
forceUpdateSchedules a job to instantly update targets.
Returns
GameObject from what the target is created otherwise if there is no GameObject for that target the return null.

◆ GetClosestTargets() [1/2]

NativeSlice< Target > Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetClosestTargets ( bool forceUpdate)

Gets targets for both entities and GameObject. Then sorts them.

Normally update is done every frame so manually calling this at the middle of frame with forceUpdate = true might impact performance. Case where this might be needed is when something is destroyed on the main thread and the new target search is required immediately for next function or when measuring performance.

Parameters
forceUpdateSchedules a job to instantly update targets instead of using chunkKeysForTargeting from the update loop.
Returns
NativeSlice/List of sorted targets.

◆ GetClosestTargets() [2/2]

NativeSlice< Target > Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetClosestTargets ( bool forceUpdate,
bool coldStart )

Gets targets for both entities and GameObject. Then sorts them in case force update is used. Otherwise just returns the target list.

Normally update is done every frame so manually calling this at the middle of frame with forceUpdate = true impacts performance. Case where this might be needed is when something is destroyed on the main thread and the new target search is required immediately for next function or when measuring performance

Parameters
forceUpdateSchedules a job to instantly update targets instead of using chunkKeysForTargeting from the update loop
coldStartAlso initialize System. This enables the system to work before Start() is called. This means that you can ask the system to provide data during game object to entity conversion phase. For example to provide data for projectile authoring.
Returns
New list of sorted targets

◆ GetCullingModeAsInt()

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetCullingModeAsInt ( )

◆ GetGeoInfoBasedOnHashCode()

TargetingSystemDataModels.GeometryInfo Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetGeoInfoBasedOnHashCode ( int4 geoInfoHashCode)

Gets you a GeoInfo of a target object based on the given hashcode. Does not care about if its seen or not.

Parameters
geoInfoHashCodeThe hashcode from target struct. Target.geoInfoHashCode
Returns
related gameObjects transform, null if not found.

◆ GetSeenGeoInfoBasedOnHashCode()

TargetingSystemDataModels.GeometryInfo Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetSeenGeoInfoBasedOnHashCode ( int4 geoInfoHashCode)

Gets you a visible GeoInfo of a target object based on the given hashcode.

Parameters
geoInfoHashCodeThe hashcode from target struct. Target.geoInfoHashCode
Returns
related gameObjects transform, null if not found.

◆ GetTargetBasedOnHashCode()

Target Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetTargetBasedOnHashCode ( int4 geoInfoHashCode)

Gets you a GeoInfo of a target object based on the hashCode inside it.

Parameters
geoInfoHashCodeThe hashcode from target struct. Target.geoInfoHashCode
Returns
related gameObjects transform, null if not found.

◆ GetVisibilityProcessor< T >()

T Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GetVisibilityProcessor< T > ( )

Used to get the eye implementation for either game object or entities from hash set.

Template Parameters
TImplementation to get. If none exists return default T
Returns

◆ OnAfterDeserialize()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.OnAfterDeserialize ( )

◆ OnBeforeSerialize()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.OnBeforeSerialize ( )

◆ RemoveTargetingInstruction()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.RemoveTargetingInstruction ( TargetingInstruction targetingInstruction)

◆ SetGameObjectBasedProcessingOnOrOff()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.SetGameObjectBasedProcessingOnOrOff ( bool onOff)

◆ TriggerTargetingActions()

void Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TriggerTargetingActions ( Target target)

Spawn prefabs from actions template object.

Property Documentation

◆ AdditionalTargetsCount

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.AdditionalTargetsCount
getset

◆ BlockTargetsOutsideIndicatorVisibilityDistance

bool Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.BlockTargetsOutsideIndicatorVisibilityDistance
getset

◆ ClosestEdgeFetchedForCurrentFrame

bool Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ClosestEdgeFetchedForCurrentFrame
getset

◆ ClosestEdgeTarget

EdgeDataModels.Edge Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ClosestEdgeTarget
getset

◆ ClosestTarget

Target Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ClosestTarget
getset

◆ ClosestTargetsContainer

NativeList<Target> Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.ClosestTargetsContainer
getset

For direct access use memory as below. This returns temporary copy of the memory.

◆ CullingBehaviour

TargetingSystemDataModels.CullingBehaviour Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.CullingBehaviour
getset

◆ EntityBasedProcessing

bool Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.EntityBasedProcessing
get

◆ FieldOfView

float Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.FieldOfView
getset

◆ GameObjectProcessing

bool Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.GameObjectProcessing
getset

◆ IndicatorVisibilityDistance

float Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.IndicatorVisibilityDistance
getset

◆ NumberOfIndicatorsToShow

uint Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.NumberOfIndicatorsToShow
getset

◆ NumberOfLockedTargets

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.NumberOfLockedTargets
getset

◆ NumberOfTargets

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.NumberOfTargets
getset

◆ PreviousNumberOfLockedTargets

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.PreviousNumberOfLockedTargets
getset

◆ PreviousNumberOfTargets

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.PreviousNumberOfTargets
getset

◆ SystemsMemory

TargetingSystemMemory Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.SystemsMemory
getset

◆ TargetIndicatingEnabled

bool Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetIndicatingEnabled
getset

◆ TargetingDistance

float Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingDistance
getset

◆ TargetingIndicatorObject

Transform Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingIndicatorObject
getset

Targeting locator or indicator GameObject made to visualise the closest target, if wanted.

Setter that also checks, if gameObject is in the scene and then spawns, if not.

◆ TargetingIndicatorSlotToUse

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingIndicatorSlotToUse
get

◆ TargetingInstructions

List<TargetingInstruction> Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingInstructions
get

◆ TargetingInstructionsWithRefresh

List<TargetingInstruction> Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingInstructionsWithRefresh
get

Has refresh functionality added to the getter. Use this for adding new instruction in non performance critical scenarios. It re updates cache and fixes missing target processors if any.

◆ TargetingSystemGroupIndex

int Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingSystemGroupIndex
getset

◆ TargetingSystemIndex

int4 Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingSystemIndex
getset

◆ TargetingSystemsRunner

TargetingSystemsRunner Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetingSystemsRunner
getset

Link to targetingSystemsRunner that is shared across all targeting systems.

◆ TargetSettingsBlendWeight

float Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetSettingsBlendWeight
getset

◆ TargetVisibilityProcessors

SortedList<ITargetVisibilityProcessor, ITargetVisibilityProcessor> Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.TargetVisibilityProcessors
getset

◆ VisibilityDebugger

TargetVisibilityDebugger Plugins.TargetingSystem.BaseCode.MainClasses.GV_TargetingSystem.VisibilityDebugger
getset

The documentation for this class was generated from the following file: