Minimal setup to set up a local PlayCanvas development using TypeScript.
This works with my other parcel plugin parcel-plugin-playcanvas for a seamless local <-> PlayCanvas Editor workflow.
- Clone this repo
npm install
oryarn install
to pull the dependenciesnpm run serve
oryarn serve
for development,.ts
files are watched and rebundle and upload to PlayCanvas automaticallynpm build
for a production build
import { createScript } from "../../extensions/create-script-decorator"
import { ScriptTypeBase } from "../../extensions/script-type-base"
import { IAttributeCollection } from "../../@types"
@createScript()
export class HelloWorld extends ScriptTypeBase implements pc.ScriptType {
name = 'ABC'
attributes: IAttributeCollection = {
test: { type: 'string' }
}
initialize() {
console.log(this.test)
}
}
https://github.com/whydoidoit/babel-playcanvas-template
https://github.com/snowfrogdev/typescript-playcanvas-template
Thank you!