The RenderTags
property of the CameraComponent
class is a collection of tags that determine which game objects are included when rendering the camera's view. If no tags are specified, the camera will render all objects in the scene.
The RenderTags
property of the CameraComponent
class is a collection of tags that determine which game objects are included when rendering the camera's view. If no tags are specified, the camera will render all objects in the scene.
Use the RenderTags
property to filter the objects that the camera should render based on their tags. This is useful for optimizing rendering performance by excluding unnecessary objects or focusing on specific elements in the scene.
// Example of setting RenderTags for a CameraComponent CameraComponent camera = new CameraComponent(); // Create a new TagSet and add tags TagSet tags = new TagSet(); tags.Add("Player"); tags.Add("Enemy"); // Assign the TagSet to the RenderTags property camera.RenderTags = tags; // Now the camera will only render objects with the "Player" or "Enemy" tags.