var f=Object.defineProperty;var P=(n,t,o)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var i=(n,t,o)=>(P(n,typeof t!="symbol"?t+"":t,o),o);import{E as y,bp as u,s as c,p as m,C as b,t as h,e as C,bq as _,br as g,u as v,bs as O,bt as S}from"./index-03b6134d.js";import"./index-0a53aaef.js";import{c as E}from"./Component-3cb422ab.js";import"./postmen-9e6354af.js";var A=Object.defineProperty,w=Object.getOwnPropertyDescriptor,p=(n,t,o,r)=>{for(var e=r>1?void 0:r?w(t,o):t,a=n.length-1,l;a>=0;a--)(l=n[a])&&(e=(r?l(t,o,e):l(e))||e);return r&&e&&A(t,o,e),e};let s=class extends y{constructor(t,o){super(t,o);i(this,"animatorController",null);i(this,"cullingMode",u.None);i(this,"speed",1)}async bindEngineObject(t){await super.bindEngineObject(t),t.enabled=!1}rebindEngineObject(t){super.rebindEngineObject(t),t.enabled=!1}};p([c(),m({type:b.AssetPicker,assetType:"AnimatorController",label:"animation.animator-controller.controller.title",info:"animation.animator-controller.controller.info",bindPath:"animatorController"})],s.prototype,"animatorController",2);p([c(),m({type:b.Select,label:"animation.animator-controller.culling-mode.title",info:"animation.animator-controller.culling-mode.info",options:h(u,void 0,n=>C(`animation.animator-controller.culling-mode.${n.toLowerCase()}`)),bindPath:"cullingMode"})],s.prototype,"cullingMode",2);p([c(),m({type:b.Number,label:"animation.animator-controller.speed.title",info:"animation.animator-controller.speed.info",bindPath:"speed"})],s.prototype,"speed",2);s=p([E({type:"Animator",componentsMenu:{label:"component.animator.title"},unique:!0})],s);class j extends _{constructor(){super(...arguments);i(this,"_animatorComponents",[]);i(this,"onScriptPlay")}init(o){this.onScriptPlay=o.onScriptPlay}onPlay(o){this.engine.sceneManager.scenes[0].rootEntities.forEach(e=>{e.getComponentsIncludeChildren(g,this._animatorComponents)}),this._animatorComponents.forEach(e=>{e.enabled=o,o||e._reset()}),this.onScriptPlay&&this.onScriptPlay(o)}}var M=Object.defineProperty,D=Object.getOwnPropertyDescriptor,$=(n,t,o,r)=>{for(var e=r>1?void 0:r?D(t,o):t,a=n.length-1,l;a>=0;a--)(l=n[a])&&(e=(r?l(t,o,e):l(e))||e);return r&&e&&M(t,o,e),e};let d=class{constructor(n){i(this,"script");i(this,"root");v(this),this.root=n}init(){this.script=O.addScript(j),this.script.init({onScriptPlay:n=>{var t;(t=this.root.animatorControllerStore)==null||t.updateGlobalPlayState(n)}})}};d=$([S({type:"animatorStore"})],d);export{s as A,d as a};
