A class that looks for objects with a ProximityManaged class on them, and enables/disables them based on their settings. This class is meant as an example of how you can deal with large scenes with a lot of objects, disabling the ones that are far away from the action to save on performance. Note that there are many ways to do it, this one is simple and generic, there may be better choices for your specific use case.
More...
A class that looks for objects with a ProximityManaged class on them, and enables/disables them based on their settings. This class is meant as an example of how you can deal with large scenes with a lot of objects, disabling the ones that are far away from the action to save on performance. Note that there are many ways to do it, this one is simple and generic, there may be better choices for your specific use case.
◆ AddControlledObject()
virtual void MoreMountains.TopDownEngine.ProximityManager.AddControlledObject |
( |
ProximityManaged |
newObject | ) |
|
|
virtual |
A public method used to add new controlled objects at runtime
- Parameters
-
◆ EvaluateDistance()
virtual void MoreMountains.TopDownEngine.ProximityManager.EvaluateDistance |
( |
| ) |
|
|
protectedvirtual |
Checks distances if needed
◆ GrabControlledObjects()
virtual void MoreMountains.TopDownEngine.ProximityManager.GrabControlledObjects |
( |
| ) |
|
|
protectedvirtual |
Grabs all proximity managed objects in the scene
◆ InitializeStatics()
static void MoreMountains.TopDownEngine.ProximityManager.InitializeStatics |
( |
| ) |
|
|
staticprotected |
Statics initialization to support enter play modes
◆ OnDisable()
virtual void MoreMountains.TopDownEngine.ProximityManager.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On disable we stop listening for events
◆ OnEnable()
virtual void MoreMountains.TopDownEngine.ProximityManager.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable we start listening for events
◆ OnMMEvent()
virtual void MoreMountains.TopDownEngine.ProximityManager.OnMMEvent |
( |
TopDownEngineEvent |
engineEvent | ) |
|
|
virtual |
When we get a level start event, we assign our player as a target
- Parameters
-
◆ SetPlayerAsTarget()
virtual void MoreMountains.TopDownEngine.ProximityManager.SetPlayerAsTarget |
( |
| ) |
|
|
protectedvirtual |
Grabs the player from the level manager
◆ Start()
virtual void MoreMountains.TopDownEngine.ProximityManager.Start |
( |
| ) |
|
|
protectedvirtual |
On start we grab our controlled objects
◆ Update()
virtual void MoreMountains.TopDownEngine.ProximityManager.Update |
( |
| ) |
|
|
protectedvirtual |
On Update we check our distances
◆ _lastEvaluationAt
float MoreMountains.TopDownEngine.ProximityManager._lastEvaluationAt = 0f |
|
protected |
◆ AutomaticallyGrabControlledObjects
bool MoreMountains.TopDownEngine.ProximityManager.AutomaticallyGrabControlledObjects = true |
◆ AutomaticallySetPlayerAsTarget
bool MoreMountains.TopDownEngine.ProximityManager.AutomaticallySetPlayerAsTarget = true |
whether or not to automatically grab the player from the LevelManager once the scene loads
◆ ControlledObjects
List<ProximityManaged> MoreMountains.TopDownEngine.ProximityManager.ControlledObjects |
the list of objects to check proximity with
◆ EvaluationFrequency
float MoreMountains.TopDownEngine.ProximityManager.EvaluationFrequency = 0.5f |
the frequency, in seconds, at which to evaluate distances and enable/disable stuff
◆ ProximityTarget
Transform MoreMountains.TopDownEngine.ProximityManager.ProximityTarget |
the target to detect proximity with
◆ RequireProximityTarget
bool MoreMountains.TopDownEngine.ProximityManager.RequireProximityTarget = true |
in this mode, if there's no ProximityTarget, proximity managed objects will be disabled
The documentation for this class was generated from the following file: