Some checks failed
		
		
	
	studiorailgun/Renderer/pipeline/head There was a failure building this commit
				
			
		
			
				
	
	
		
			78 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { engine } from "/Scripts/engine/engine-init";
 | |
| import { Scene } from "/Scripts/types/scene";
 | |
| import { Vector } from "/Scripts/types/spatial";
 | |
| 
 | |
| /**
 | |
|  * The main scene interface
 | |
|  */
 | |
| class TestScene1 extends Scene {
 | |
|     
 | |
|     /**
 | |
|      * Called when the scene is created
 | |
|      * @param instanceId The scene instanceId
 | |
|      */
 | |
|     onCreate = (instanceId: number) => {
 | |
|         console.log('Hello from the scene! My ID is ' + instanceId)
 | |
|         console.log(Object.keys(this))
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * All hooks for the scene
 | |
|      */
 | |
|     hooks = [
 | |
|         
 | |
|         /**
 | |
|          * Equip item hook
 | |
|          */
 | |
|         {
 | |
|             signal: "equipItem",
 | |
|             callback: (entityId: number) => {
 | |
|                 // throw tutorial message
 | |
|                 engine.classes.simulation.static.setFramestep(0)
 | |
|                 engine.classes.tutorialUtils.static.showTutorialHint(
 | |
|                     "EquippingItems",
 | |
|                     true,
 | |
|                     () => {
 | |
|                         engine.classes.simulation.static.setFramestep(2)
 | |
|                     }
 | |
|                 )
 | |
|             }
 | |
|         },
 | |
| 
 | |
|         /**
 | |
|          * Move hook
 | |
|          */
 | |
|         {
 | |
|             signal: "entityGroundMove",
 | |
|             callback: (entityId: number, newPos: Vector) => {
 | |
|                 // console.log("Entity moved " + entityId + " to " + Vector.toString(newPos))
 | |
|             }
 | |
|         },
 | |
| 
 | |
|         /**
 | |
|          * Storing an item in inventory
 | |
|          */
 | |
|         {
 | |
|             signal: "itemPickup",
 | |
|             callback: (entityId: number, inWorldItemEntityId: number, inInventoryItemEntityId: number) => {
 | |
|                 // throw tutorial message
 | |
|                 engine.classes.simulation.static.setFramestep(0)
 | |
|                 engine.classes.tutorialUtils.static.showTutorialHint(
 | |
|                     "GrabbingItems",
 | |
|                     true,
 | |
|                     () => {
 | |
|                         engine.classes.simulation.static.setFramestep(2)
 | |
|                     }
 | |
|                 )
 | |
|             }
 | |
|         },
 | |
| 
 | |
|     ]
 | |
| 
 | |
| }
 | |
| 
 | |
| /**
 | |
|  * The scene to export
 | |
|  */
 | |
| export default TestScene1
 |