ezEngine Release 26.9
Loading...
Searching...
No Matches
ezEmptyGameObjectAssetCheckRule Class Reference

#include <AssetCheckRules.h>

Inheritance diagram for ezEmptyGameObjectAssetCheckRule:

Public Member Functions

virtual ezStringView GetDisplayName () const override
 
virtual ezStringView GetDescription () const override
 
virtual bool CanFix () const override
 Whether the rule can fix the issues it reports. If false, auto-fix has no effect for it.
 
virtual bool AppliesToDocumentType (ezStringView sDocumentTypeName) const override
 Whether the rule should run on documents of the given type. Defaults to all types.
 
virtual void CheckDocument (ezAssetCheckContext &ref_ctx) override
 
- Public Member Functions inherited from ezReflectedClass
virtual const ezRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const ezRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
EZ_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Protected Member Functions

virtual void CheckObject (ezAssetCheckContext &ref_ctx, const ezDocumentObject *pObject) override
 
- Protected Member Functions inherited from ezAssetCheckRule
virtual void CheckProperty (ezAssetCheckContext &ref_ctx, const ezDocumentObject *pObject, const ezAbstractProperty *pProp)
 

Additional Inherited Members

- Static Public Member Functions inherited from ezAssetCheckRule
static void CreateRules (ezDynamicArray< ezAssetCheckRule * > &out_rules)
 Allocates one instance of every reflected, allocatable rule type, sorted by display name.
 
static void DestroyRules (ezDynamicArray< ezAssetCheckRule * > &ref_rules)
 
- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 
- Static Protected Member Functions inherited from ezAssetCheckRule
static ezResult GetPropertyValues (ezObjectAccessorBase *pAcc, const ezDocumentObject *pObject, const ezAbstractProperty *pProp, ezDynamicArray< ezVariant > &out_indices, ezDynamicArray< ezVariant > &out_values)
 

Detailed Description

Reports ezGameObjects that have no name, no components and no child objects, i.e. that have no effect on the scene. Auto-fix removes them.

Member Function Documentation

◆ AppliesToDocumentType()

bool ezEmptyGameObjectAssetCheckRule::AppliesToDocumentType ( ezStringView  sDocumentTypeName) const
overridevirtual

Whether the rule should run on documents of the given type. Defaults to all types.

Reimplemented from ezAssetCheckRule.

◆ CanFix()

virtual bool ezEmptyGameObjectAssetCheckRule::CanFix ( ) const
inlineoverridevirtual

Whether the rule can fix the issues it reports. If false, auto-fix has no effect for it.

Reimplemented from ezAssetCheckRule.

◆ CheckDocument()

void ezEmptyGameObjectAssetCheckRule::CheckDocument ( ezAssetCheckContext ref_ctx)
overridevirtual

Inspects the document and reports all issues via ref_ctx.ReportIssue.

The default implementation visits the document's root object and every object below it and calls CheckObject for each (child objects reached through properties marked with ezTemporaryAttribute are skipped). Rules that follow this per-object / per-property structure only need to override CheckObject or CheckProperty. Override CheckDocument itself to replace the traversal entirely.

If ref_ctx.IsAutoFixAllowed() is true, the rule also fixes the issues through ref_ctx.GetObjectAccessor() and reports them with bFixed = true. The runner manages the undo transaction, so implementations must not call Start/Finish/CancelTransaction.

Reimplemented from ezAssetCheckRule.

◆ CheckObject()

void ezEmptyGameObjectAssetCheckRule::CheckObject ( ezAssetCheckContext ref_ctx,
const ezDocumentObject pObject 
)
overrideprotectedvirtual

Inspects a single object as part of the default CheckDocument traversal.

The default iterates all of the object's properties, skipping those marked with ezTemporaryAttribute, and calls CheckProperty for each. Child objects are visited separately by the traversal and must not be recursed into here.

Reimplemented from ezAssetCheckRule.

◆ GetDescription()

ezStringView ezEmptyGameObjectAssetCheckRule::GetDescription ( ) const
overridevirtual

Implements ezAssetCheckRule.

◆ GetDisplayName()

virtual ezStringView ezEmptyGameObjectAssetCheckRule::GetDisplayName ( ) const
inlineoverridevirtual

Implements ezAssetCheckRule.


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