PlayCanvas-szkriptek életciklusa
A véletlen betöltési sorrend helyett kimondja a szkriptfüggőségeket és takarítást. Kezeli az engedélyezést, tiltást, másolást és törlést, hogy az időzítő és eseménykezelő a gazdáját kövesse.
playcanvas-scripts-lifecycle
Nézd meg, miben segítMikor hasznos?
Akkor használd, ha ismételt entitáslétrehozás figyelőt vagy késői visszahívást hagy.
Miben segít neked?
- Ellenőrzi az ESM vagy klasszikus API-t és regisztrált szkriptnevet.
- Véletlen betöltési sorrend helyett importot és hivatkozást határoz meg.
- Életciklushoz rendeli a figyelő, időzítő és aszinkron munka gazdáját.
Például ezt kérheted
Az ellenfél-generátor minden szobanyitáskor megduplázza a kibocsátást. Kövesd a szkriptfüggőségeket, feliratkozásokat és időzítőket. Tiltsd, engedélyezd, másold és töröld a szobát; minden aktív generátor egyszer működjön, a törölt szoba pedig ne reagáljon késői eredményre.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
PlayCanvas — scripts lifecycle
Use when implementing PlayCanvas entity scripts, initialization order, enable/disable or destruction.
Version and project gate
Inspect Engine version, Engine-only versus hosted Editor workflow, ESM versus classic scripts, build/export process, asset IDs and tags, render backend, script attributes and target browser requirements. Do not assume a paid Editor service is required for Engine-only work. Never turn a task into an engine upgrade without the user’s intent. Read the version-matching official reference when an API decision depends on it.
Work
Identify ESM or classic script APIs and registered script names. Declare dependencies through imports and explicit entity references rather than incidental asset loading order. Define initialize/post-initialize/update and disable/destroy ownership for listeners, timers and asynchronous work.
Deliver
A script dependency/lifecycle map and restart-safe implementation. Keep the change in the existing project structure; separate actual observations from the proposed acceptance scenario below.
Failure to prevent
Script loading order is not the same as component method execution order; a file name need not equal the registered script name.
Acceptance scenario
Enable, disable, clone and destroy an entity repeatedly while checking one active listener and no late callback writes. Follow the project’s execution and verification permissions. If execution or a target device is unavailable, provide the reproduction steps and name the remaining uncertainty; do not mark it passed.
Scope and sources
This skill belongs to Cyra. Agent selection is restricted by Orqestria’s assigned-agent policy, including forced skill selection; instruction text alone is not an access control. These are original task workflows researched from official documentation, not a copied or endorsed vendor skill.
- https://developer.playcanvas.com/user-manual/editor/scripting/loading-order/
- https://developer.playcanvas.com/user-manual/assets/loading-unloading/
- https://developer.playcanvas.com/user-manual/optimization/guidelines/
Task-specific official references
Csomagban lévő fájlok 1
SKILL.md
