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
Gets the optional Model path. Null if resource loaded in scene
path to Model resource.
ProtectedruntimeInternal runtime access
Compare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
ProtectedequalsCompare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
Internal: Release Model resources after use
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.
Take resource ownership. release() will release the resource. Can be used to release models loaded in scenes accessed through ModelResource field getter.
StaticcreateInternal: instance creator by runtime.resources.loadModel()
Cogs runtime instance.
Path to load.
Name of model
Optionalflags: ModelLoadFlagsOptional Model loading flags. Default: ModelLoadFlags.None
Created instance
StaticcreateInternal: Create a Model from existing resource Called from field getter for Model
Cogs Model Resource.
Created by: Cogs.Resources.loadModel() Release using: ModelResource.release()