Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro.Sensors.FilteredSensor Class Reference

Detailed Description

Sensor that pass only objects that pass conditions defined with ASensorFilter.

Inheritance diagram for Doloro.Sensors.FilteredSensor:
Collaboration diagram for Doloro.Sensors.FilteredSensor:

Public Member Functions

void ReloadFilters ()
 Dropping current collection of bond filters and looking for new.
 
void Refilter ()
 Forcing drop of current filtered collection and call of new filter for entire triggered list.
 
bool Refilter (GameObject target)
 Forcing recheck triggered object with filters. More...
 
bool RemoveFilter (ASensorFilter filter)
 Removing filter from the list. More...
 
bool ContainsFilter< T > ()
 Checks is the sensor already has the filter assigned from the type. More...
 
bool FindFilter< T > (out ASensorFilter filter)
 Checks is the sensor already has the filter assigned from the type. More...
 
void AddFilter (ASensorFilter filter)
 Adding filter to collection. Re-filters triggered objects. More...
 
override void Add (GameObject item)
 Adding object to triggered collection. Sending object to the filters. More...
 
override bool Remove (GameObject item)
 Trying to remove object from triggered. More...
 
override void Clear ()
 Cleared collections of detected objects. More...
 
override void CopyTo (GameObject[] array, int arrayIndex)
 Copying filtered objects to destination array. More...
 
override bool Contains (GameObject item)
 Checks is the object exists among filtered. More...
 
IEnumerator< GameObject > GetEnumeratorForTriggered ()
 Returns enumerator for entire triggered objects without filters applying. More...
 
override IEnumerator< GameObject > GetEnumerator ()
 Returns enumerator for triggered objects passed filters. More...
 

Static Public Attributes

static Hashtable registred = new Hashtable()
 Hash table that contain the pairs (Transform Holder -> List{SensorManager}) that registered in the system. Use this for optimizing of access.
 

Protected Member Functions

override void Awake ()
 Occurs when object instantiated. More...
 
virtual void OnFilterModified (ASensorFilter filter)
 Handler that calls Refilter in case if sensor's settings was modified. More...
 
virtual bool Filter (GameObject obj)
 Checking is the game object crossed trigger bounds passed the filters or not. More...
 
virtual void OnDestroy ()
 Occurs when sensors zone destroying. More...
 
virtual void OnTriggerEnter (Collider collision)
 Occurs when trigger collides with game object. More...
 
virtual void OnTriggerExit (Collider collision)
 Occurs when game object leaving trigger bounds. More...
 

Protected Attributes

List< GameObject > triggered = new List<GameObject>()
 List that contain the game objects that placed in zone in current time.
 

Properties

override int Count [get]
 Returns count of objects passed filters.
 
ASensorFilter[] BondFilters [get]
 Array of filters applied to sensor.
 
GameObject LastEnterDetection [get]
 Last game object that was detected on zone enter. More...
 
GameObject LastExitDetection [get]
 Last game object that was detected on zone exit.
 
virtual bool IsReadOnly [get]
 Always false.
 
int Id [get, set]
 Id of current sensor behaviorManager. Using for hot binding.
 

Events

System.Action< GameObject > Filtered
 Occurs when game object will enter to a sensor borders and passed filters.
 
System.Action< GameObject > Detected
 Occurs when game object enters to a sensor borders.
 
System.Action< GameObject > Exited
 Occurs when game object leaves a sensor borders.
 
System.Action< int > IdChanged
 Occurs when Id is changed. Sharing id before change.
 

Member Function Documentation

◆ Add()

override void Doloro.Sensors.FilteredSensor.Add ( GameObject  item)
virtual

Adding object to triggered collection. Sending object to the filters.

Parameters
itemItem to manual triggering.

Reimplemented from Doloro.Sensors.Sensor.

◆ AddFilter()

void Doloro.Sensors.FilteredSensor.AddFilter ( ASensorFilter  filter)

Adding filter to collection. Re-filters triggered objects.

Parameters
filterFilter to add.
Returns
Exceptions
System.ArgumentNullExceptionvalue is null.

◆ Awake()

override void Doloro.Sensors.FilteredSensor.Awake ( )
protectedvirtual

Occurs when object instantiated.

Reimplemented from Doloro.Sensors.Sensor.

◆ Clear()

override void Doloro.Sensors.FilteredSensor.Clear ( )
virtual

Cleared collections of detected objects.

Reimplemented from Doloro.Sensors.Sensor.

◆ Contains()

override bool Doloro.Sensors.FilteredSensor.Contains ( GameObject  item)
virtual

Checks is the object exists among filtered.

Parameters
itemItem to check.
Returns
Result of check.

Reimplemented from Doloro.Sensors.Sensor.

◆ ContainsFilter< T >()

bool Doloro.Sensors.FilteredSensor.ContainsFilter< T > ( )

Checks is the sensor already has the filter assigned from the type.

Template Parameters
TType or some inherit type of the filter.
Returns
Result of search.

◆ CopyTo()

override void Doloro.Sensors.FilteredSensor.CopyTo ( GameObject[]  array,
int  arrayIndex 
)
virtual

Copying filtered objects to destination array.

Parameters
arrayDestination array
arrayIndexStart index at destination array.

Reimplemented from Doloro.Sensors.Sensor.

◆ Filter()

virtual bool Doloro.Sensors.FilteredSensor.Filter ( GameObject  obj)
protectedvirtual

Checking is the game object crossed trigger bounds passed the filters or not.

Parameters
obj
Returns

◆ FindFilter< T >()

bool Doloro.Sensors.FilteredSensor.FindFilter< T > ( out ASensorFilter  filter)

Checks is the sensor already has the filter assigned from the type.

Template Parameters
TType or some inherit type of the filter.
Parameters
filterReference to filter. Null if not found.
Returns
Result of search.

◆ GetEnumerator()

override IEnumerator< GameObject > Doloro.Sensors.FilteredSensor.GetEnumerator ( )
virtual

Returns enumerator for triggered objects passed filters.

Returns
Enumerator instance.

Reimplemented from Doloro.Sensors.Sensor.

◆ GetEnumeratorForTriggered()

IEnumerator< GameObject > Doloro.Sensors.FilteredSensor.GetEnumeratorForTriggered ( )

Returns enumerator for entire triggered objects without filters applying.

Returns
Enumerator instance.

◆ OnDestroy()

virtual void Doloro.Sensors.Sensor.OnDestroy ( )
protectedvirtualinherited

Occurs when sensors zone destroying.

Reimplemented in Doloro.Sensors.DependentFilteredSensor.

◆ OnFilterModified()

virtual void Doloro.Sensors.FilteredSensor.OnFilterModified ( ASensorFilter  filter)
protectedvirtual

Handler that calls Refilter in case if sensor's settings was modified.

Parameters
filterModified filter.

◆ OnTriggerEnter()

virtual void Doloro.Sensors.Sensor.OnTriggerEnter ( Collider  collision)
protectedvirtualinherited

Occurs when trigger collides with game object.

Parameters
collisionTriggered collider.

Reimplemented in Doloro.Sensors.DependentFilteredSensor.

◆ OnTriggerExit()

virtual void Doloro.Sensors.Sensor.OnTriggerExit ( Collider  collision)
protectedvirtualinherited

Occurs when game object leaving trigger bounds.

Parameters
collision

Reimplemented in Doloro.Sensors.DependentFilteredSensor.

◆ Refilter()

bool Doloro.Sensors.FilteredSensor.Refilter ( GameObject  target)

Forcing recheck triggered object with filters.

Parameters
targetObject registered at the trigger.
Returns
Result of filtering.
Exceptions
System.AccessViolationExceptionObject not registered by sensor trying to affect the register.

◆ Remove()

override bool Doloro.Sensors.FilteredSensor.Remove ( GameObject  item)
virtual

Trying to remove object from triggered.

Parameters
itemItem to remove.
Returns
Result of removing.

Simulates regular reaction the same as object left the trigger bound by itself.

Reimplemented from Doloro.Sensors.Sensor.

◆ RemoveFilter()

bool Doloro.Sensors.FilteredSensor.RemoveFilter ( ASensorFilter  filter)

Removing filter from the list.

Parameters
filterFilter to remove.
Returns
Result of filter search.

Property Documentation

◆ LastEnterDetection

GameObject Doloro.Sensors.Sensor.LastEnterDetection
getinherited

Last game object that was detected on zone enter.

Will updated in case if setted object leaving the sensor's range. Null in case if any objects left.


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