Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

22 lines (17 sloc) 554 Bytes
import {Carryable, CarryableSystem} from 'carryable';
// Make a box.
let box = new Entity();
engine.addEntity(box);
box.addComponent(new BoxShape());
box.addComponent(new Transform({
position: new Vector3(8, 0.5, 8)
}));
// Add the Carryable Component to the box.
let carryable = new Carryable();
box.addComponent(carryable);
// Set up toggling of the carry state via clicking.
box.addComponent(new OnClick(() => {
carryable.toggleCarry();
}));
// Create a CarryableSystem to update our Carryable object.
engine.addSystem(new CarryableSystem());
You can’t perform that action at this time.