GetObjectCount
Syntax
GetObjectCount(isStatic: boolean = false): numberParameters
Parameter
Type
Description
Return Value
Description
Example
// Get count of regular objects
const regularCount = this.api.GetObjectCount();
console.log(`Regular objects: ${regularCount}`);
// Get count of static objects
const staticCount = this.api.GetObjectCount(true);
console.log(`Static objects: ${staticCount}`);
// Use counts in a loop
for (let i = 0; i < this.api.GetObjectCount(); i++) {
const objectName = this.api.GetObjectName(i);
console.log(`Object ${i}: ${objectName}`);
}Last updated