Class EntityVisualsModule
Create and manages visuals for MARS Entities
Inheritance
EntityVisualsModule
Inherited Members
Namespace: Unity.MARS
Syntax
public class EntityVisualsModule : EditorScriptableSettings<EntityVisualsModule>, IModuleDependency<SlowTaskModule>, IModule
Properties
provider
Declaration
public IProvidesCameraOffset provider { get; set; }
Property Value
| Type | Description |
|---|---|
| IProvidesCameraOffset |
simEntitiesRoot
If the module is set to create visuals for simulation, it will look for entities under this transform root.
Declaration
public Transform simEntitiesRoot { get; set; }
Property Value
| Type | Description |
|---|---|
| Transform |
Methods
ConnectDependency(SlowTaskModule)
Declaration
public void ConnectDependency(SlowTaskModule dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| SlowTaskModule | dependency |
Implements
DisableVisualCollision(MARSEntity)
Disable the collider for an entity's visual. Used for preventing an entity from attaching to its own visual.
Declaration
public void DisableVisualCollision(MARSEntity entity)
Parameters
| Type | Name | Description |
|---|---|---|
| MARSEntity | entity | The entity for which the visual should be disabled. |
GetVisual(MARSEntity)
Declaration
public EntityVisual GetVisual(MARSEntity entity)
Parameters
| Type | Name | Description |
|---|---|---|
| MARSEntity | entity |
Returns
| Type | Description |
|---|---|
| EntityVisual |
InvalidateVisual(MARSEntity)
Removes the current visual for an entity so that it will be recreated.
Declaration
public void InvalidateVisual(MARSEntity entity)
Parameters
| Type | Name | Description |
|---|---|---|
| MARSEntity | entity | The entity for which the visual is invalid |
LoadModule()
Declaration
public void LoadModule()
Implements
ResetVisualCollision()
Reset all collision with entity visuals that had previously been disabled using DisableVisualCollision
Declaration
public void ResetVisualCollision()
UnloadModule()
Declaration
public void UnloadModule()
Implements
UpdateColor(MARSEntity)
Update the visual color for an entity
Declaration
public void UpdateColor(MARSEntity entity)
Parameters
| Type | Name | Description |
|---|---|---|
| MARSEntity | entity | The entity that needs its visual to be updated |