"use strict";(self.webpackChunkplaycanvas_game=self.webpackChunkplaycanvas_game||[]).push([[507],{507:(e,t,o)=>{o.r(t),o.d(t,{default:()=>i});const i={name:"Mobile Garage Scene",description:"A mobile-optimized garage practice area with strategic camera positioning",async build(e,t,o){console.log("[MobileGarageScene] Building mobile-optimized garage...");const i=o.create("MobileGarageRoot",{position:[0,0,0],tags:["scene_root"]}),a=t.createRoom({size:[24,5,20],position:[0,0,0],lighting:"workshop"});a.name="MobileGarageRoom",i.addChild(a),this.setupLighting(a,o),this.createWorkbenchZone(a,o),this.createPracticeObjectsZone(a,o),this.createStorageZone(a,o),this.createControlZone(a,o);const n=o.create("SpawnPoint",{position:[0,0,8],tags:["spawn"]});return i.addChild(n),console.log("[MobileGarageScene] Mobile garage built successfully"),i},setupLighting(e,t){const o=t.createLight("point",{color:new pc.Color(1,1,.95),intensity:3,range:20,position:[0,4,0]});e.addChild(o),[{pos:[-8,3,6],color:[1,1,.9],intensity:2.5},{pos:[-8,3,-6],color:[.9,1,1],intensity:2.5},{pos:[8,3,0],color:[1,.95,.9],intensity:2.5},{pos:[0,3,-8],color:[.8,.9,1],intensity:2}].forEach((o,i)=>{const a=t.createLight("point",{color:new pc.Color(o.color[0],o.color[1],o.color[2]),intensity:o.intensity,range:8,position:o.pos});e.addChild(a)})},createWorkbenchZone(e,t){const o=t.create("MainWorkbench",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[3,.4,1.5]},rigidbody:{type:"static"}},position:[-8,.8,6],scale:[6,.8,3],tags:["furniture","workbench","interactive","mobile_optimized"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.4,.2),e.emissive=new pc.Color(.05,.02,.01),e.update(),o.model.material=e}e.addChild(o),[{name:"Hammer",pos:[-9,1.2,6],scale:[.4,.2,1.6],color:[.7,.7,.8]},{name:"Wrench",pos:[-8,1.2,5.5],scale:[.3,.15,1.2],color:[.8,.7,.6]},{name:"Screwdriver",pos:[-7,1.2,6.5],scale:[.2,.1,1],color:[.9,.8,.3]},{name:"Pliers",pos:[-8.5,1.2,7],scale:[.3,.2,.8],color:[.6,.6,.7]}].forEach(o=>{const i=t.create(o.name,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[o.scale[0]/2,o.scale[1]/2,o.scale[2]/2]},rigidbody:{type:"dynamic"}},position:o.pos,scale:o.scale,tags:["tool","interactive","mobile_optimized"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(o.color[0],o.color[1],o.color[2]),e.update(),i.model.material=e}e.addChild(i)});const i=t.create("ToolCabinet",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,2,.5]},rigidbody:{type:"static"}},position:[-11,2,6],scale:[2,4,1],tags:["furniture","storage","interactive","mobile_optimized"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.3,.3,.4),e.emissive=new pc.Color(.02,.02,.03),e.update(),i.model.material=e}e.addChild(i)},createPracticeObjectsZone(e,t){[{name:"Practice_Cube",type:"box",pos:[-10,1,-4],scale:[2,2,2],color:[1,.3,.3]},{name:"Practice_Sphere",type:"sphere",pos:[-7,1,-4],scale:[1.5,1.5,1.5],color:[.3,1,.3]},{name:"Practice_Cylinder",type:"cylinder",pos:[-4,1.5,-4],scale:[1.5,3,1.5],color:[.3,.3,1]},{name:"Movable_Box",type:"box",pos:[-10,1,-7],scale:[1.5,1.5,1.5],color:[1,.6,0],movable:!0},{name:"Heavy_Block",type:"box",pos:[-7,1,-7],scale:[2,1,2],color:[.5,.5,.5],movable:!0},{name:"Light_Ball",type:"sphere",pos:[-4,1,-7],scale:[1,1,1],color:[1,1,.3],movable:!0},{name:"Gear_Large",type:"cylinder",pos:[-10,.3,-10],scale:[2.5,.6,2.5],color:[.8,.6,.2]},{name:"Gear_Medium",type:"cylinder",pos:[-7,.25,-10],scale:[2,.5,2],color:[.7,.5,.2]},{name:"Gear_Small",type:"cylinder",pos:[-4,.2,-10],scale:[1.5,.4,1.5],color:[.6,.4,.2]}].forEach(o=>{const i=t.create(o.name,{components:{model:{type:o.type},collision:{type:o.type},rigidbody:{type:o.movable?"dynamic":"static"}},position:o.pos,scale:o.scale,tags:["practice_object","interactive","mobile_optimized",o.movable?"movable":"static"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(o.color[0],o.color[1],o.color[2]),e.emissive=new pc.Color(.1,.1,.1),e.update(),i.model.material=e}o.name.includes("Gear")&&(i.rotationSpeed=.5+.5*Math.random(),i.script={update:function(e){this.entity.rotate(0,this.rotationSpeed*e*30,0)}.bind({entity:i,rotationSpeed:i.rotationSpeed})}),e.addChild(i)});const o=t.create("PracticeSign",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,.5,.1]},rigidbody:{type:"static"}},position:[-7,3,-2],scale:[3,1,.2],tags:["decoration","sign"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.3,.5),e.emissive=new pc.Color(.1,.1,.2),e.update(),o.model.material=e}e.addChild(o)},createStorageZone(e,t){[{pos:[10,2,-8],items:["Component_A","Component_B","Component_C"]},{pos:[10,2,-3],items:["Part_X","Part_Y","Part_Z"]},{pos:[10,2,2],items:["Module_1","Module_2","Module_3"]},{pos:[10,2,7],items:["Tool_Set_A","Tool_Set_B","Tool_Set_C"]}].forEach((o,i)=>{const a=t.create(`StorageShelf_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.8,2,.3]},rigidbody:{type:"static"}},position:o.pos,scale:[1.6,4,.6],tags:["furniture","shelf","interactive","mobile_optimized"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.4,.3,.2),e.update(),a.model.material=e}e.addChild(a),o.items.forEach((a,n)=>{const s=t.create(a,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.25,.25,.25]},rigidbody:{type:"dynamic"}},position:[o.pos[0]-.5,o.pos[1]+.8*(n-1),o.pos[2]+.4],scale:[.5,.5,.5],tags:["component","interactive","mobile_optimized"]});if(s.model){const e=new pc.StandardMaterial,t=[[.8,.2,.2],[.2,.8,.2],[.2,.2,.8],[.8,.8,.2]],o=t[i%t.length];e.diffuse=new pc.Color(o[0],o[1],o[2]),e.emissive=new pc.Color(.05,.05,.05),e.update(),s.model.material=e}e.addChild(s)})}),[[8,.5,-8],[8,.5,-3],[8,.5,2],[8,.5,7]].forEach((o,i)=>{const a=t.create(`PartsBin_${i}`,{components:{model:{type:"box"},collision:{type:"box",halfExtents:[.6,.4,.6]},rigidbody:{type:"static"}},position:o,scale:[1.2,.8,1.2],tags:["storage","interactive","mobile_optimized"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.6,.6,.7),e.update(),a.model.material=e}e.addChild(a)})},createControlZone(e,t){const o=t.create("MainControlPanel",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[2,1,.3]},rigidbody:{type:"static"}},position:[0,2,-9],scale:[4,2,.6],tags:["interactive","control_panel","mobile_optimized"]});if(o.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.2,.2,.3),e.emissive=new pc.Color(.05,.1,.2),e.update(),o.model.material=e}e.addChild(o),[{name:"PowerButton",pos:[-1,2.5,-8.7],color:[0,1,0]},{name:"ResetSwitch",pos:[0,2.5,-8.7],color:[1,1,0]},{name:"EmergencyStop",pos:[1,2.5,-8.7],color:[1,0,0]}].forEach(o=>{const i=t.create(o.name,{components:{model:{type:"cylinder"},collision:{type:"cylinder",radius:.2,height:.2},rigidbody:{type:"static"}},position:o.pos,scale:[.4,.2,.4],tags:["interactive","control_element","mobile_optimized"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(o.color[0],o.color[1],o.color[2]),e.emissive=new pc.Color(.3*o.color[0],.3*o.color[1],.3*o.color[2]),e.update(),i.model.material=e}e.addChild(i)});const i=t.create("InfoScreen",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1.5,1,.1]},rigidbody:{type:"static"}},position:[0,3.5,-8.9],scale:[3,2,.2],tags:["interactive","screen","mobile_optimized"]});if(i.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.1,.1,.2),e.emissive=new pc.Color(0,.2,.4),e.update(),i.model.material=e}e.addChild(i);const a=t.create("MobileInstructions",{components:{model:{type:"box"},collision:{type:"box",halfExtents:[1,.8,.05]},rigidbody:{type:"static"}},position:[3,1.5,-8.95],scale:[2,1.6,.1],tags:["interactive","instructions","mobile_optimized"]});if(a.model){const e=new pc.StandardMaterial;e.diffuse=new pc.Color(.9,.9,.8),e.emissive=new pc.Color(.1,.1,.05),e.update(),a.model.material=e}e.addChild(a)},objectives:[{id:"mobile_garage_intro",name:"Welcome to Mobile Garage",description:"Explore the mobile-optimized practice area",type:"simple",autoStart:!0,rewards:{experience:20}},{id:"explore_all_zones",name:"Visit All Zones",description:"Use camera angles to explore all 4 garage zones",type:"counter",target:4,progress:0,rewards:{experience:40}},{id:"mobile_object_interaction",name:"Touch Practice Objects",description:"Interact with 8 different practice objects",type:"counter",target:8,progress:0,rewards:{experience:60}},{id:"workbench_mastery",name:"Workbench Area",description:"Interact with workbench and all tools",type:"counter",target:5,progress:0,rewards:{experience:50}},{id:"storage_access",name:"Storage Management",description:"Access all storage areas and components",type:"counter",target:8,progress:0,rewards:{experience:50}},{id:"control_panel_master",name:"Control Panel Expert",description:"Master the mobile-optimized control systems",type:"simple",prerequisites:["explore_all_zones","mobile_object_interaction"],rewards:{experience:100,items:[{id:"mobile_garage_certificate",quantity:1}]}}],state:{zonesExplored:new Set,objectsInteracted:new Set,workbenchInteractions:new Set,storageAccessed:new Set,controlPanelUsed:!1,currentZone:"overview"},onLoad(e,t){console.log("[MobileGarageScene] Mobile garage loaded, setting up mobile-optimized experience...");const o=t.getSystem("objectivemanager");o&&(o.clearAllObjectives(),this.objectives.forEach(e=>{o.defineObjective(e.id,e)}),o.startObjective("mobile_garage_intro"),o.startObjective("explore_all_zones")),this.setupMobileInteractions(e,t),e.fire("ui:notification",{text:"Mobile Garage Ready! Swipe between camera angles to explore different zones. Tap objects to interact.",type:"info",duration:6e3}),setTimeout(()=>{o&&(o.completeObjective("mobile_garage_intro"),o.startObjective("mobile_object_interaction"),o.startObjective("workbench_mastery"),o.startObjective("storage_access"))},3e3)},setupMobileInteractions(e,t){const o=t.getSystem("objectivemanager"),i=t=>{const i=t.name||`zone_${t.index}`;this.state.zonesExplored.add(i),this.state.currentZone=i,o&&o.isObjectiveActive("explore_all_zones")&&o.updateObjective("explore_all_zones",this.state.zonesExplored.size);const a={Workbench:"Workbench Zone: Tools and crafting area","Practice Objects":"Practice Zone: Interactive 3D objects","Storage Shelves":"Storage Zone: Components and parts",Overview:"Overview: Complete garage perspective"};a[i]&&e.fire("ui:notification",{text:a[i],type:"info",duration:2e3})};e.on("camera:angleChanged",i),this.angleChangeHandler=i;const a=t=>{console.log(`[MobileGarageScene] Mobile interaction: ${t}`),this.state.objectsInteracted.has(t)||(this.state.objectsInteracted.add(t),e.fire("ui:notification",{text:`Examined: ${t.replace(/_/g," ")}`,type:"success",duration:1500}),o&&o.isObjectiveActive("mobile_object_interaction")&&o.updateObjective("mobile_object_interaction",this.state.objectsInteracted.size)),(t.includes("Workbench")||t.includes("Tool")||"ToolCabinet"===t)&&(this.state.workbenchInteractions.has(t)||(this.state.workbenchInteractions.add(t),o&&o.isObjectiveActive("workbench_mastery")&&o.updateObjective("workbench_mastery",this.state.workbenchInteractions.size))),(t.includes("Shelf")||t.includes("Bin")||t.includes("Component")||t.includes("Part")||t.includes("Module"))&&(this.state.storageAccessed.has(t)||(this.state.storageAccessed.add(t),o&&o.isObjectiveActive("storage_access")&&o.updateObjective("storage_access",this.state.storageAccessed.size))),(t.includes("Control")||t.includes("Button")||t.includes("Switch")||t.includes("Screen"))&&(this.state.controlPanelUsed||(this.state.controlPanelUsed=!0,e.fire("ui:notification",{text:"Mobile Control System Activated: All systems operational for touch interaction.",type:"success",duration:4e3}),this.state.zonesExplored.size>=4&&this.state.objectsInteracted.size>=8&&o&&(o.startObjective("control_panel_master"),setTimeout(()=>{o.completeObjective("control_panel_master"),e.fire("ui:notification",{text:"Mobile Garage Mastery Achieved! You've completed the mobile-optimized practice area.",type:"success",duration:6e3})},2e3))))};e.on("interaction:triggered",a),this.interactHandler=a},onUnload(e,t){console.log("[MobileGarageScene] Cleaning up mobile garage scene..."),this.angleChangeHandler&&(e.off("camera:angleChanged",this.angleChangeHandler),this.angleChangeHandler=null),this.interactHandler&&(e.off("interaction:triggered",this.interactHandler),this.interactHandler=null),this.state&&(this.state.zonesExplored?.clear(),this.state.objectsInteracted?.clear(),this.state.workbenchInteractions?.clear(),this.state.storageAccessed?.clear(),this.state.controlPanelUsed=!1,this.state.currentZone="overview")}}}}]);