AbstractProtectedconstructorInitialize AbstractResource
Cogs.js Runtime.
Resource id.
Optional resource name
ProtectedbridgeInternal bridge access
Gets the COGS resource ID of the Resource
resource ID
InternalSet resource id
Returns flag marking if resource is released
Gets the optional name
name of the resource
ProtectedruntimeInternal runtime access
ProtectedequalsCompare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
Does actual resource release. Override in sub-class.
ProtectedlogLog error message
Release to free resources after use. Also release local handle after creating resource and passing to Cogs.
const model = runtime.ModelEntity.create("Model");
const modelResource: runtime.resources.loadModel(modelPath);
model.modelComponent.model = modelResource;
modelResource.release(); // ModelComponent now sole owner
internalRelease for actual release.
Abstract Base class for Resource classes:
See