@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
2 lines (1 loc) • 4.64 kB
JavaScript
import{platform as s}from"../core/platform.js";import{WebglGraphicsDevice as r}from"../platform/graphics/webgl/webgl-graphics-device.js";import{SoundManager as o}from"../platform/sound/manager.js";import{Lightmapper as m}from"./lightmapper/lightmapper.js";import{BatchManager as e}from"../scene/batching/batch-manager.js";import{AppBase as t}from"./app-base.js";import{AppOptions as p}from"./app-options.js";import{script as i}from"./script.js";import{AnimationComponentSystem as n}from"./components/animation/system.js";import{AnimComponentSystem as a}from"./components/anim/system.js";import{AudioListenerComponentSystem as c}from"./components/audio-listener/system.js";import{AudioSourceComponentSystem as l}from"./components/audio-source/system.js";import{ButtonComponentSystem as f}from"./components/button/system.js";import{CollisionComponentSystem as j}from"./components/collision/system.js";import{ElementComponentSystem as d}from"./components/element/system.js";import{JointComponentSystem as h}from"./components/joint/system.js";import{LayoutChildComponentSystem as y}from"./components/layout-child/system.js";import{LayoutGroupComponentSystem as g}from"./components/layout-group/system.js";import{ModelComponentSystem as u}from"./components/model/system.js";import{ParticleSystemComponentSystem as b}from"./components/particle-system/system.js";import{RenderComponentSystem as v}from"./components/render/system.js";import{RigidBodyComponentSystem as x}from"./components/rigid-body/system.js";import{ScreenComponentSystem as D}from"./components/screen/system.js";import{ScriptLegacyComponentSystem as O}from"./components/script-legacy/system.js";import{ScrollViewComponentSystem as w}from"./components/scroll-view/system.js";import{ScrollbarComponentSystem as P}from"./components/scrollbar/system.js";import{SoundComponentSystem as C}from"./components/sound/system.js";import{SpriteComponentSystem as H}from"./components/sprite/system.js";import{ZoneComponentSystem as S}from"./components/zone/system.js";import{CameraComponentSystem as k}from"./components/camera/system.js";import{LightComponentSystem as I}from"./components/light/system.js";import{ScriptComponentSystem as M}from"./components/script/system.js";import{GSplatComponentSystem as R}from"./components/gsplat/system.js";import{RenderHandler as z}from"./handlers/render.js";import{AnimationHandler as q}from"./handlers/animation.js";import{AnimClipHandler as A}from"./handlers/anim-clip.js";import{AnimStateGraphHandler as B}from"./handlers/anim-state-graph.js";import{AudioHandler as E}from"./handlers/audio.js";import{BinaryHandler as F}from"./handlers/binary.js";import{ContainerHandler as G}from"./handlers/container.js";import{CssHandler as J}from"./handlers/css.js";import{CubemapHandler as K}from"./handlers/cubemap.js";import{FolderHandler as L}from"./handlers/folder.js";import{FontHandler as N}from"./handlers/font.js";import{GSplatHandler as Q}from"./handlers/gsplat.js";import{HierarchyHandler as T}from"./handlers/hierarchy.js";import{HtmlHandler as U}from"./handlers/html.js";import{JsonHandler as V}from"./handlers/json.js";import{MaterialHandler as W}from"./handlers/material.js";import{ModelHandler as X}from"./handlers/model.js";import{SceneHandler as Y}from"./handlers/scene.js";import{ScriptHandler as Z}from"./handlers/script.js";import{ShaderHandler as $}from"./handlers/shader.js";import{SpriteHandler as _}from"./handlers/sprite.js";import{TemplateHandler as ss}from"./handlers/template.js";import{TextHandler as rs}from"./handlers/text.js";import{TextureAtlasHandler as os}from"./handlers/texture-atlas.js";import{TextureHandler as ms}from"./handlers/texture.js";import{XrManager as es}from"./xr/xr-manager.js";class ts extends t{constructor(s,r={}){var t;super(s);const i=new p;i.graphicsDevice=null!=(t=r.graphicsDevice)?t:this.createDevice(s,r),this.addComponentSystems(i),this.addResourceHandles(i),i.elementInput=r.elementInput,i.keyboard=r.keyboard,i.mouse=r.mouse,i.touch=r.touch,i.gamepads=r.gamepads,i.scriptPrefix=r.scriptPrefix,i.assetPrefix=r.assetPrefix,i.scriptsOrder=r.scriptsOrder,i.soundManager=new o,i.lightmapper=m,i.batchManager=e,i.xr=es,this.init(i)}createDevice(o,m){return m.graphicsDeviceOptions||(m.graphicsDeviceOptions={}),s.browser&&navigator.xr&&(m.graphicsDeviceOptions.xrCompatible=!0),m.graphicsDeviceOptions.alpha=m.graphicsDeviceOptions.alpha||!1,new r(o,m.graphicsDeviceOptions)}addComponentSystems(s){s.componentSystems=[x,j,h,n,a,u,v,k,I,i.legacy?O:M,l,C,c,b,D,d,f,w,P,H,g,y,S,R]}addResourceHandles(s){s.resourceHandlers=[z,q,A,B,X,W,ms,rs,V,E,Z,Y,K,U,J,$,T,L,N,F,os,_,ss,G,Q]}}export{ts as Application};