Skip to main content

Resources

Runtime resource loader bound to the current effect.

TypeNameInterface Description
Static Functionsexist(path: string): boolean

Function: Check whether a resource is available under the given project path. The path is resolved relative to Assets/resources and may be supplied with or without a file suffix.

Parameters

path: - The original project path of the resource to check.

Returns true when the path resolves to at least one bundled asset, false otherwise.

Static FunctionsgetAllPaths(): string[]

Function: Get every original project path of the resources bundled with the current effect package. Paths are returned in their original casing as authored in the Effect House project.

Returns An array of original project paths; empty when no resources are bundled with the current effect.

Static Functionsload(path: string): any

Function: Load a resource by its original project path. The path may be supplied with or without its file suffix; when multiple resources share the same base path, the first match is returned. Supported asset types: - Texture (.png, .jpg, .jpeg, .bmp, .gifTex, .animTex) - Material (.omtl, .mg) - Prefab (.prefab) - Mesh / Model (.fbx, .obj, .glb, .gltf) - JsonAsset (.userjson)

Parameters

path: - The original project path of the resource to load.

Returns The loaded resource instance, or null if the current scene has no active asset manager or the path cannot be resolved to a known resource.

Static FunctionsloadAll(path: string): any[]

Function: Load every resource that matches the given project path. When the path is supplied without a file suffix, all resources sharing the same base path are returned, ordered by resource type priority (images first, followed by materials, prefabs and meshes). Supported asset types: - Texture (.png, .jpg, .jpeg, .bmp, .gifTex, .animTex) - Material (.omtl, .mg) - Prefab (.prefab) - Mesh / Model (.fbx, .obj, .glb, .gltf) - JsonAsset (.userjson)

Parameters

path: - The original project path of the resources to load. The path is resolved relative to Assets/resources and may be specified with or without a file suffix.

Returns The loaded resource instances in priority order, or an empty array when the current scene has no active asset manager or the path cannot be resolved to any resource.

Examples

exist(path: string): boolean

if (APJS.Resources.exist('icon.png')) {
const icon = APJS.Resources.load('icon.png');
// Use the loaded resource...
}

getAllPaths(): string[]

const paths = APJS.Resources.getAllPaths();
for (const path of paths) {
console.log(path);
}

load(path: string): any

// Load a texture using its full path (relative to Assets/resources).
const icon = APJS.Resources.load('icon.png');

// Load by base path (suffix omitted).
const material = APJS.Resources.load('character');

if (icon) {
// Use the loaded resource...
}

loadAll(path: string): any[]

// Load every material variant that shares the same base path.
const materials = APJS.Resources.loadAll('PBR');

// Load a specific material by its full path.
const pbr = APJS.Resources.loadAll('PBR.omtl');

for (const material of materials) {
// Use each loaded material...
}

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use Resources here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies